<Script language = "JavaScript">
VaR xmlhttpreq = false;
// XMLHttpRequest
Function createxmlhttprequest ()
{
If (window. XMLHttpRequest)
{
// Mozilla
Xmlhttpreq = new xmlhttprequet ();
}
Else if (window. actionxobject)
{
// IE
Try {
Xmlhttpreq = new activexobject ("msxml2.xmlhttp ");
}
Catch (E)
{
Try {
Xmlhttpreq = new activexobject ("Microsoft. XMLHTTP ");
}
Catch (e ){}
}
}
}
//
Function sendrequest (URL)
{
Createxmlhttprequest ();
Xmlhttpreq. Open ("get", URL, true );
Xmlhttpreq. onreadystatechange = processresponse ;//??
Xmlhttpreq. Send (null );//
}
// Function for processing returned information
Function processresponse ()
{
If (xmlhttpreq. readystate = 4)
{// Determine the object status
If (xmlhttpreq. Status = 200)
{// The information has been returned successfully. Start to process the information.
VaR res = xmlhttpreq. responsexml. getelementsbytagname ("res") [0]. firstchild. Data;
Window. Alert (RES );
}
Else
{// The page is abnormal.
Window. Alert ("the page you requested has an exception .");
}
}
}