var xmlHttp;
uName() //User When name loses focus
{
if(all.uname.=="")
{
all.l1.innerHTML="Cannot be empty!";
setTimeout("close( 1)",1500);
return;
}
else
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.onreadystatechange=deal; // Callback function
var url="aJax.aspx?user='" all.uname. "'"; //Will jump to the page where the user name is detected
xmlHttp.open("get",url,true ); //Submit the form to the url using get mode; and start one-step processing
xmlHttp.send(null); //Send
}
}
deal()
{
//alert(xmlHttp.readystate "__" xmlHttp.status);
if(xmlHttp.readystate!=4)
{return; }
if(xmlHttp.status!=200) //When equal to 500, it is an error in the sql statement or database
{return;}
//
var num = xmlHttp.responseText; //Receive information sent by the server
//alert(num);
all.l1.innerText="";
if(num>0)
{
all.l1.innerText="This username has been used!";
}
else
{
all.l1.innerText="√";
}
}