You are here: Reference > JavaScript > client-side > HTML DOM > properties > readyState (object)

readyState property (object)

Browser support:
Returns an integer value that indicates the state of the object element.
Use this property together with the onreadystatechange event to be notified when the state changes.

Syntax:

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

Possible values:

Integer that represents the state of the object.
One of the following values:
0
Object is not initialized.
1
The data of the object is currently loading.
2
The data of the object has been loaded.
3
A part of the data is available.
4
Initialization is ready.
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">
        function GetState (elem) {
            var flash = document.getElementById ("flash");
            alert ("readyState: " + flash.readyState);
        }
    </script> 
</head>
<body onload="GetState ()">
    <object id="flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
        codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="300" height="120">
        <param name="movie" value="flash.swf" />
    </object>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content