Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. function loadXMLDoc()
  6. {
  7. if (window.XMLHttpRequest)
  8. {// code for IE7+, Firefox, Chrome, Opera, Safari
  9. xmlhttp=new XMLHttpRequest();
  10. }
  11. else
  12. {// code for IE6, IE5
  13. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  14. }
  15. xmlhttp.onreadystatechange=function()
  16. {
  17. document.write("Test. ");
  18. document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
  19. }
  20. xmlhttp.open("GET","twitterFeed.txt",false);
  21. xmlhttp.send();
  22. }
  23. </script>
  24. </head>
  25. <body>
  26.  
  27. <h2>Using the XMLHttpRequest object</h2>
  28. <div id="myDiv"></div>
  29. <button type="button" onclick="loadXMLDoc()">Change Content</button>
  30.  
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement