Name
readyState — NN n/a IE 4 DOM n/a
Synopsis
Read-only
Returns the current download status of the document content. If a
script (especially one initiated by a user event) can perform some
actions while the document is still loading, but must avoid other
actions until the entire page has loaded, this property provides
intermediate information about the loading process. You would use its
value in condition tests. The value of this property changes during
loading as the loading state changes. Each change of the property
value fires an onReadyStateChange event.
Example
if (document.readyState == "loading") {
statements for alternate handling
}Value
One of the following values (as strings): complete
| interactive | loading |
uninitialized. Some elements may allow the user to
interact with partial content, in which case the property may return
interactive until all loading has completed.
Default
None.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access