Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var js_xmlHttp=false;
  2.  
  3. function runAjax(){
  4.     js_xmlHttp=new XMLHttpRequest();
  5.    
  6.     var js_temp1=document.getElementById("id_username").value;
  7.     var js_temp2=document.getElementById("id_password").value;
  8.    
  9.     var js_data="username="+js_temp1+"&password="+js_temp2;
  10.        
  11.     js_xmlHttp.open("POST","Display_Ajax.php",true);
  12.    
  13.     http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  14.     http.setRequestHeader("Content-length", js_data.length);
  15.     http.setRequestHeader("Connection", "close");
  16.        
  17.     js_xmlHttp.onreadystatechange=function(){
  18.         if(js_xmlHttp.readyState==4 && js_xmlHttp.status==200){
  19.             document.getElementById("id_display").innerHTML=js_xmlHttp.responseText;
  20.         }
  21.     }
  22.    
  23.     js_xmlHttp.send(js_data);  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement