CopyCodeThe Code is as follows: // Step 1: Create an XMLHTTPRequest object
VaR http_request;
Try
{
Http_request = Window. activexobject ("Microsoft. XMLHTTP ");
} Catch (E)
{
Try
{
Http_request = new XMLHttpRequest ();
} Catch (E)
{
Alert ("your browser does not support XMLHttpRequest ");
}
}
// Step 2: Specify the submitted URL
Http_request.open ("get", "url", "true"); // get is the submission method, and true is the specified Asynchronous interaction on the server.
// Step 3: process the data returned by the server
Http_request.onreadystatechange = function () // callback function, which is called four times in total. The readtstate changes to 0-> 1-> 2-> 3-> 4 (completed) in sequence );
{
If (http_request.readystate = 4) // The server completes processing.
{
If (http_request.status = 200) // The client has completed processing.
{
// Processing segment
}
}
}
// Step 4: SEND Parameters
Http_request.send (null); // sending Parameters