Retrieves the current state of the request operation.
Syntax
[ nState = ] XMLHttpRequest.readyState
Possible Values
nState | Integer that
receives one of the following values.0 (Uninitialized) | The object has been created, but not initialized (the open method has not been called). | 1 (Open) | The object has been created, but the send method has not been called. | 2 (Sent) | The send method has been called, but the status and headers are not yet available. | 3 (Receiving) | Some data has been received. | 4 (Loaded) | All the data has been received, and is available. |
|
The property is read-only.
The property has no default value.
Remarks
You cannot call responseBody and responseText properties to obtain partial results (readyState = 3). Doing so will return an error, because status and response headers are not fully available. You must wait until all data has been received.
In comparison, the Microsoft XML (MSXML) version of the IXMLHTTPRequest interface exposes partial results through the responseStream property, which the Microsoft Internet Explorer native version does not implement. Be aware that this behavior also differs from the IServerXMLHTTPRequest interface, which provides partial results to responseBody and responseText.
readyState was introduced in Internet Explorer 7.
Applies To
See Also
onreadystatechange