Ajax has no code to refresh the application when registering the user name

Time:2022-5-28

var xmlHttp; 
Unname() / / when the user name loses focus

 if(all.uname.==””) 
 { 
All L1.innerhtml= “cannot be empty!”; The
  setTimeout(“close(1)”,1500); 
  return; 
 } 
 else 
 { 
  xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”); 
Xmlhttp Onreadystatechange=deal; / / callback function
Var url= “ajax.aspx? User='” +all Uname+ “‘”; / / you will jump to the page where the user name is detected
Xmlhttp Open (“get”, URL, true); / / submit the form to the URL in the get mode; And start next step processing
Xmlhttp Send (null); / / send
 } 

deal() 

 //alert(xmlHttp.readystate+”__”+xmlHttp.status); 
 if(xmlHttp.readystate!=4) 
 {return; } 

If (xmlhttp.status! =200) / / an SQL statement or database error occurs when it is equal to 500
 {return;} 
 // 

Var num = xmlhttp ResponseText; / / receive the information sent by the server
 //alert(num); 
 all.l1.innerText=””; 
 if(num>0) 
 { 
All L1.innertext= “secondary user name has been used!”; The
 } 
 else  
 { 
  all.l1.innerText=”√”; 
 } 

}