Definition and Usage..
The readyState property returns the (loading) status of the current document.
Note: This property is read-only.
Return Value: A String, representing the status of the current document.
One of five values:
uninitialized - Has not started loading yet
loading - Is loading
loaded - Has been loaded
interactive - Has loaded enough and the user can interact with it
complete - Fully loaded
Syntax: document.readyState
CODING:The readyState property returns the (loading) status of the current document.
Note: This property is read-only.
Return Value: A String, representing the status of the current document.
One of five values:
uninitialized - Has not started loading yet
loading - Is loading
loaded - Has been loaded
interactive - Has loaded enough and the user can interact with it
complete - Fully loaded
Syntax: document.readyState
<!DOCTYPE html>
<html>
<body>
<p>Click the button to display the loading status of the current document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.readyState;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
<html>
<body>
<p>Click the button to display the loading status of the current document.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.readyState;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>
Comments
Post a Comment