// ------------------- Ajax begin --------------------------
VaR XMLHTTP;
Function createxmlhttprequest (){
// Indicates that the current browser is not IE, such as ns or Firefox
If (window. XMLHttpRequest ){
XMLHTTP = new XMLHttpRequest ();
} Else if (window. activexobject ){
XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
}
}
Function validate (){
Createxmlhttprequest ();
VaR clientid = Document. getelementbyid ("clientid"). value;
VaR url = "../servlet/clientidvalidateservlet? Clientid = "+ clientid +" & timestampt = "+ new date (). gettime ();
XMLHTTP. Open ("get", URL, true );
XMLHTTP. onreadystatechange = callback;
XMLHTTP. Send (null );
}
Function callback (){
If (XMLHTTP. readystate = 4 ){
If (XMLHTTP. Status = 200 ){
VaR restextspan = Document. getelementbyid ("restext ");
Restextspan. innerhtml = "<font color = 'red'>" + XMLHTTP. responsetext + "</font> ";
}
}
}
// ------------------- Ajax end --------------------------