Guest User

Untitled

a guest
May 20th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. script.js is:
  2. xmlhttp = new XMLHttpRequest();
  3. document.getElementById("test").innerHTML=xmlhttp.responseText;
  4. xmlhttp.open("GET","script.js");
  5. xmlhttp.send();
  6. alert(1);
  7.  
  8.  
  9. Test page is:
  10. <html>
  11. <body>
  12. <script id="test" src="script.js"></script>
  13. </body>
  14. </html>
  15.  
  16. 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