Share Pastebin
Guest
Public paste!

Waldir

By: a guest | Mar 20th, 2010 | Syntax: JavaScript | Size: 0.59 KB | Hits: 50 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function loadXMLDoc(url)
  5. {
  6.   xmlhttp=new XMLHttpRequest();
  7.   xmlhttp.open("GET",url,true);
  8.   xmlhttp.send(null);
  9.   xmlhttp.onreadystatechange=function()
  10.   {
  11.     if(xmlhttp.readyState==4)
  12.       {
  13.         document.getElementById('test').innerHTML=xmlhttp.responseText
  14.       }
  15.   }
  16. }
  17. </script>
  18. </head>
  19.  
  20. <body>
  21.  
  22. <div id="test">
  23. <h2>Click to let AJAX change this text</h2>
  24. </div>
  25. <button type="button" onclick="loadXMLDoc('http://toolserver.org/~magnus/whatisthat.php?onlynew&raw&image=Asf084.jpg')">Click Me</button>
  26.  
  27. </body>
  28. </html>