The readyState PropertyThe readyState property gives you some indication of the progress of an object loading its data. For example, an <IMG> element might take some time to load an image, and you can use this property to check when it's done. You can see the support for this property in Table 5.46. Table 5.46. The readyState Property
The possible strings returned, such as "complete" or "loaded" appear in Table 5.47. (The <OBJECT> element returns numbers rather than strings, and those numbers are also listed in Table 5.47.) Table 5.47. The readyState Property Values
For example, you can check the readyState property of an image named image1 like this: document.all.image1.readyState . Although Internet Explorer 4.0 supported this property for only a few elements (such as <IMG> , <OBJECT> , and <EMBED> ), starting with Internet Explorer 5.0 you can use this property on nearly every element. TIP You can't use the readyState property to check whether an element itself is loaded, just whether its data is loadedthe element itself needs to be present before you can even use the readyState property. |