document.readyState
The readyState property returns three different values.
Value | Description |
---|---|
loading | The browser is loading the document. |
interactive | The document has been parsed, but the browser is still loading linked resources. |
complete | The document has been parsed and all of the resources have been loaded. |
The value of the readyState property moves from loading to interactive to complete.
The readystatechange event is triggered each time the value of the readyState property changes.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
<script>
document.onreadystatechange = function() {
if (document.readyState == "interactive") {
alert("results");
}
}
</script>
</head>
<body>
</body>
</html>
Home
JavaScript Book
DOM
JavaScript Book
DOM
Document:
- The Document Object
- document.body returns the body element as HTMLBodyElement
- document.characterSet returns document character set encoding
- document.charset gets or sets the document character set encoding
- document.compatMode
- document.cookie reads and writes cookies
- document.defaultCharset gets the default character encoding
- document.defaultView
- document.getElementsByTagName( tagName )
- document.getElementsByClassName ( className )
- document.getElementsByName ( nameOfNameAttribute )
- document.images gets all the img elements and returns HTMLCollection storing all images
- document.lastModified returns the last modified time of the document
- document.location returns the URL of the current document as Location class
- document.implementation property has information about the implementation of the DOM features
- document.querySelectorAll gets all of the elements that match the specified CSS selector
- document.readyState
- document.title returns the document title, changes the document title
- document.URL property returns the URL of the current document
- document.writeln() appends content to the end of the HTML document
- Using Properties to Obtain Element Objects