Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Properties
 readyState Property
readyState Property

Retrieves a value that indicates the current state of the object.

Syntax

HTMLN/A
Scripting[ sState = ] object.readyState

Possible Values

sStateString that receives one of the following values.
uninitialized
Object is not initialized with data.
loading
Object is loading its data.
loaded
Object has finished loading its data.
interactive
User can interact with the object even though it is not fully loaded.
complete
Object is completely initialized.

The property is read-only. The property has no default value.

Remarks

An object's state is initially set to uninitialized, and then to loading. When data loading is complete, the state of the link object passes through the loaded and interactive states to reach the complete state.

The states through which an object passes are determined by that object; an object can skip certain states (for example, interactive) if the state does not apply to that object.

Data source objects and databound elements are normally populated asynchronously, and certain programmatic operations can only be performed reliably on databound objects when they are ready for use. Therefore, the appropriate code should be written to confirm the readyState of objects prior to performing certain operations on them. For example, walking the rows of a table should not be attempted until after the table has reached the complete state.

The readyState property enables the status of an object to be tested. The correct place to test the readyState property is in the event handler for onreadystatechange. Similarly, a data source object (DSO) fires the ondatasetcomplete event to notify the Web page that the dataset is ready for programmatic operation.

Standards Information

There is no public standard that applies to this property.

Applies To

document, FRAME, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, LINK, SCRIPT, TABLE, TBODY, TD, TFOOT, TH, THEAD, TR, Element Constructor, HTMLDocument Constructor

See Also

onreadystatechange
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
readyState does not indicate error      yecril ... Thomas Lee   |   Edit   |   Show History
If the element cannot load the source for whatever reason, its ready state is set to complete.
deficiency - clipBoard/dataTransfer lacks readyState      Mr. Raymond Kenneth Petry ... Thomas Lee   |   Edit   |   Show History
There's no way to know whether it is ready to paste.
receive complete before receive loaded      gulunmu   |   Edit   |   Show History

in my case,when i load js file dynamicly with createlement(script). in onreadystatechange handler,i check readystate, if found complete before loaded.

Tags What's this?: Add a tag
Flag as ContentBug
Will it work for JavaScript as well      Mallipeddi   |   Edit   |   Show History
Hi

I'm working on automation of javascript application. The issue is QTP is able to find the existence of the object before it actually displays in to us. the wait properites are not working..

I tried using object.currentstyle...that is also not working...Can we use this to find the real existence of object in UI
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker