Advertisement
Guest User

Untitled

a guest
Sep 5th, 2015
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="ISO-8859-1">
  5. <title>Insert title here</title>
  6. <script>
  7. function loadXMLDoc()
  8. {
  9. var xmlhttp;
  10. if (window.XMLHttpRequest)
  11. {// code for IE7+, Firefox, Chrome, Opera, Safari
  12. xmlhttp=new XMLHttpRequest();
  13. }
  14. else
  15. {// code for IE6, IE5
  16. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  17. }
  18. xmlhttp.onreadystatechange=function()
  19. {
  20. if (xmlhttp.readyState==4 && xmlhttp.status==200)
  21. {
  22. document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
  23. }
  24. }
  25. xmlhttp.open("GET","AjaxTest",true);
  26. xmlhttp.send();
  27. }
  28. </script>
  29.  
  30. </head>
  31.  
  32. <body>
  33.  
  34.  
  35. <div id="myDiv"><h2>Let AJAX change this text</h2></div>
  36. <input type="email" name="email" >
  37. <button type="button" onclick="loadXMLDoc()">Change Content</button>
  38.  
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement