You are here: Reference > JavaScript > client-side > HTML DOM > properties > readyState (document, a, abbr, ...)

readyState property (document, a, abbr, ...)

Browser support:
3.6
Returns a string value that represents the state of the object.
Use this property together with the onreadystatechange event to be notified when the state changes.
Note that in Firefox, Opera, Google Chrome and Safari, the readyState property is not supported by HTML elements (except by the script element in Opera), only the document object supports it (in Firefox from version 3.6).

Syntax:

object.readyState;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

String that represents the state of the object.
One of the following values:
complete
Initialization is ready.
interactive
A part of the data is available.
loaded
The data of the object has been loaded.
loading
The data of the object is currently loading.
uninitialized
Object is not initialized.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the readyState property:
<head>
    <script type="text/javascript">
        alert ("readyState: " + document.readyState);
        function Init () {
            alert ("readyState: " + document.readyState);
        }
    </script> 
</head>
<body onload="Init ()">
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content