10 out of 24 rated this helpful - Rate this topic

readyState property

[This documentation is preliminary and is subject to change.]

Retrieves the current state of the request operation.

Syntax

JavaScript

p = object.readyState

Property values

Type: Integer

READYSTATE_UNINITIALIZED (0)

The object has been created, but not initialized (the open method has not been called).

READYSTATE_LOADING (1)

A request has been opened, but the send method has not been called.

READYSTATE_LOADED (2)

The send method has been called. No data is available yet.

READYSTATE_INTERACTIVE (3)

Some data has been received; however, neither responseText nor responseBody is available.

READYSTATE_COMPLETE (4)

All the data has been received.

Standards information

Remarks

You cannot call responseBody and responseText properties to obtain partial results (readyState = 3). Doing so will return an error, because the response is not fully received. 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 Windows 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.

In comparison, the MSXML version of the IXMLHTTPRequest interface exposes partial results through the responseStream property. Be aware that this behavior also differs from the IServerXMLHTTPRequest interface, which provides partial results to responseBody and responseText.

For an example of how to use this property, see onreadystatechange.

readyState was introduced in Windows Internet Explorer 7.

See also

XMLHttpRequest
onreadystatechange

 

 

Build date: 2/14/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ