Microsoft XML Core Services (MSXML) 4.0 - DOM Reference
See Also
open Method | responseBody Property | responseText Property | send Method | status Property | statusText Property
Applies to: IXMLHTTPRequest
Language
C/C++
Script
Visual Basic
Show All
readyState Property (IXMLHTTPRequest)
Represents the state of the request.
Example
var XmlHttp;
XmlHttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
XmlHttp.onreadystatechange = doHttpReadyStateChange;
XmlHttp.open("GET", "http://localhost/sample.xml", true);
XmlHttp.send();
function doHttpReadyStateChange() {
if (XmlHttp.readyState == 4) {
alert("Done");
}
}
[Script]
Script Syntax
lValue = oXMLHttpRequest.readyState;
[Visual Basic]
Visual Basic Syntax
lValue = oXMLHttpRequest.readyState
[C/C++]
C/C++ Syntax
HRESULT get_readyState(long* plState);
Parameters
plState [out, retval]
State of the request, as an I4 (4-byte integer). The following values are defined:
(0) UNINITIALIZED The object has been created, but not initialized (open has not been called).
(1) LOADING The object has been created, but send has not been called.
(2) LOADED send has been called and the status and headers are available, but the response is not yet available.
(3) INTERACTIVE Some data has been received. You can call responseBody and responseText to get the current partial results.
(4) COMPLETED All the data has been received, and the complete data is available in responseBody and responseText.
C/C++ Return Values
S_OK
Value returned if successful. Remarks
Variant. The property is read-only. It represents the state of the request as an I4 (4-byte integer). The following values are defined.
0 (UNINITIALIZED) The object has been created, but not initialized (open method has not been called).
(1) LOADING The object has been created, but the send method has not been called.
(2) LOADED The send method has been called and the status and headers are available, but the response is not yet available.
(3) INTERACTIVE Some data has been received. You can call responseBody and responseText to get the current partial results.
(4) COMPLETED All the data has been received, and the complete data is available in responseBody and responseText.
This property returns a 4-byte integer.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button in the upper-left corner of the page.
See Also
open Method | responseBody Property | responseText Property | send Method | status Property | statusText Property