12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>LAN intrusion</title>
- </head>
- <body>
- <script>
- function requestPage(url, handler) {
- let request = new XMLHttpRequest();
- request.addEventListener("readystatechange", (event) => {
- console.debug("Request to", url, "has state", request.readyState, ".");
- if (request.readyState == 4 /* DONE */) {
- console.debug("Request to", url, "complete.");
- handler(request);
- }
- });
- request.open("GET", url, true);
- request.setRequestHeader( 'Access-Control-Allow-Origin', '*');
- request.send();
- }
- requestPage("http://172.20.0.81/", (request) => {
- if (request.status == 0 /* ERROR */) {
- console.log("Failed to request.");
- } else {
- console.log("Request successful.");
- }
- console.log("readyState: ", request.readyState);
- console.log("response: ", request.response);
- console.log("responseText: ", request.responseText);
- console.log("responseType: ", request.responseType);
- console.log("responseURL: ", request.responseURL);
- console.log("responseXML: ", request.responseXML);
- console.log("status: ", request.status);
- console.log("statusText: ", request.statusText);
- console.log("getAllResponseHeaders: ", request.getAllResponseHeaders());
- console.log("--------------");
- });
- </script>
- </body>
- </html>
|