From a29134ba7bbc044daf411c932468eab298818e61 Mon Sep 17 00:00:00 2001 From: nodemixaholic Date: Sun, 31 Mar 2024 21:22:27 +0000 Subject: [PATCH] Update 'frontend.js' --- frontend.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend.js b/frontend.js index 0113ec2..2326efe 100644 --- a/frontend.js +++ b/frontend.js @@ -310,6 +310,19 @@ function readInternetText(url) { return response } +function readInternetText(url) { + var request = new XMLHttpRequest(); // Create a new XMLHttpRequest object + request.open('GET', url, false); // Open the request with synchronous mode + request.send(null); // Send the request with no additional data + + if (request.status === 200) { // Check if the request was successful + return request.responseText; // Return the response text + } else { + return 'Error: ' + request.status; // Return an error message if the request failed + } +} + + function requir3(jsURL) { let req = readInternetText(jsURL); console.log(req)