Ajax framework
VaR http_request = false;
Function send_request (URL ){
Http_request = false;
If (window. XMLHttpRequest ){
Http_request = new XMLHttpRequest ();
If (http_request.overridemimetype ){
Http_request.overridemimetype ("text/XML ");
}
}
Else if (window. activexobject ){
Try {
Http_request = new activexobject ("msxml2.xmlhttp ");
} Catch (e ){
Try {
Http_request = new activexobject ("Microsoft. XMLHTTP ");
} Catch (e ){}
}
}
If (! Http_request ){
Window. Alert ("the XMLHTTPRequest object instance cannot be created .");
Return false;
}
Http_request.onreadystatechange = processfunction;
Http_request.open ("get", URL, false );
Http_request.send (null );
}
Function processfunction ()
{
If (http_request.readystate = 4 ){
If (http_request.status = 200 ){
VaR responsetext = http_request.responsetext;
// Var responsexml = http_request.responsexml;
// Process the returned object
}
Else
{
Alert ("the page you requested has an exception. ");
}
}
}
Call method:
Send_request (URL );
For example:
Send_request ('process. asp? Id = 1 & name = 2 ');