Advertisement
Guest User

Untitled

a guest
Apr 5th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2. function test(){
  3.         try {
  4.             oPageRequest=new XMLHttpRequest();
  5.             } catch (e)  {
  6.                 try {
  7.                     oPageRequest=new ActiveXObject("Msxml2.XMLHTTP");
  8.                     } catch (e) {
  9.                         try {
  10.                             oPageRequest=new ActiveXObject("Microsoft.XMLHTTP");
  11.                             } catch (e) {
  12.                                 alert("Je browser ondersteund deze actie niet.");
  13.                                  return false;
  14.                             }
  15.                     }
  16.             }
  17.             oPageRequest.open("GET","test.php",true);
  18.             oPageRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  19.            
  20.             oPageRequest.onreadystatechange=function() {
  21.                 if(oPageRequest.readyState == 4 )
  22.                     {
  23.                         document.getElementById('testz').innerHTML = oPageRequest.responseText;
  24.                     }
  25.                 }
  26.             oPageRequest.send(null);   
  27.    
  28. }
  29. </script>
  30. <div id="testz">Test</div>
  31. <input type="button" onclick="test();" value="NAO" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement