Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script.js is:
- xmlhttp = new XMLHttpRequest();
- document.getElementById("test").innerHTML=xmlhttp.responseText;
- xmlhttp.open("GET","script.js");
- xmlhttp.send();
- alert(1);
- Test page is:
- <html>
- <body>
- <script id="test" src="script.js"></script>
- </body>
- </html>
- For example, if I changed script.js to alert(1); it should alert 1, and then if I changed it to document.write("hello"); it should write hello to the page without them refreshing.
Add Comment
Please, Sign In to add comment