Link: http://hi.baidu.com/freesunshine/blog/item/a8f62ff30f250dcc0b46e094.html
<SCRIPT langage = JavaScript>
VaR XMLHTTP;
Function createxmlhttprequest ()
{
If (window. XMLHttpRequest)
{
XMLHTTP = new XMLHttpRequest ();
If (XMLHTTP. overridemimetype)
{
XMLHTTP. overridemimetype ("text/XML ");
}
}
Else if (window. activexobject)
{
Try
{
XMLHTTP = new activexobject ("msxml2.xmlhttp ");
}
Catch (E)
{
XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
}
}
If (! XMLHTTP)
{
Window. Alert ("your browser does not support creating XMLHttpRequest objects ");
}
Return XMLHTTP;
}
Function validatecode (jobno, lock)
{
Createxmlhttprequest ();
VaR url = "test/AAAA. aspx? Jobno = "+ jobno +" & lock = "+ lock;
XMLHTTP. Open ("get", URL, true );
XMLHTTP. onreadystatechange = validateresult;
XMLHTTP. Send (null );
}
Function validateresult ()
{
If (XMLHTTP. readystate = 4)
{
If (XMLHTTP. Status = 200)
{
Window. Alert (XMLHTTP. responsetext );
Window. Location. Reload ();
}
}
}
</SCRIPT>
Aaaa. aspx
Response. Write ("OK! ");
Response. Flush (); // send a response
Response. End ();