document.readyState
In this chapter you will learn:
Is document ready
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> <!-- j a v a2s .c o m-->
<html>
<head>
<script>
document.onreadystatechange = function() {
if (document.readyState == "interactive") {
alert("results");
}
}
</script>
</head>
<body>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » Javascript Tutorial » Document