Advertisement
Guest User

Untitled

a guest
Jul 8th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function loadXMLDoc()
  5. {
  6. var xmlhttp;
  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. if (xmlhttp.readyState==4 && xmlhttp.status==200)
  18. {
  19. document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
  20. }
  21. }
  22. xmlhttp.open("GET","ajax_info.jsp",true);
  23. xmlhttp.send();
  24. }
  25. </script>
  26. </head>
  27. <body>
  28.  
  29. <div id="myDiv"><h2>Let AJAX change this text</h2></div>
  30. <button type="button" onclick="loadXMLDoc()">Change Content</button>
  31.  
  32. </body>
  33. </html>
  34.  
  35. <%@ page language="java" import="java.util.*" errorPage="" %>
  36. <% boolean myInfo = false; %>
  37. <%=""+myInfo%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement