This property contains the current disposition of the element object.
You might use this in a timed event to watch the status of a document being loaded into a window or frame. Then when it has completed loading, you could activate some script within it.
Here is a list of the ready state values:
|uninitialized||The object is first instantiated, but has not begun loading.|
|loading||The object has commenced loading.|
|loaded||The object has completed loading.|
|interactive||The object is loaded but not yet closed. However, it is ready to handle interaction.|
|complete||The object body has been closed and the loading is finished.|
Note that these are string values. Some references describe a numeric value for ready states. According to the Microsoft documentation however, they are strings.
Sometimes, you can design scripts to execute while the document is downloading. Inline scripts for example. At that time, you may even be able to trigger interval timed deferred executions as well.
An object may not need to reflect the complete status before you can commence operating on it. Other objects may require that they are completely loaded. For example, you cannot create an OBJECT object that represents an <OBJECT> tag until the <BODY> has completed loading. This is because the ActiveX object construction requires a complete document body structure to attach itself to.
Every time this readyState value changes, it triggers an onReadyStateChange event call-back.