SCRIPT.readyState (Property)

The current status disposition of a <SCRIPT> block as it is being loaded.

Availability:

JScript - 3.0
Internet Explorer - 4.0
Property/method value type:String primitive
JavaScript syntax:IEmySCRIPT.readyState

This property reflects the loading state of a <SCRIPT> block that is loaded from a source file.

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.

If it is important that the document has completed loading before execution, you can check this property for one of the following values:

StateValue
uninitializedThe object is first instantiated but has not begun loading.
loadingThe object has commenced loading.
loadedThe object has completed loading.
interactiveThe object is loaded but not yet closed but is ready to handle interaction.
completeThe object body has been closed and the loading is finished.

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.

See also:onReadyStateChange

Property attributes:

ReadOnly.