HTML DOM readyState attribute



Definition and usage

The readyState property returns the status of the current document (loading...).

This property returns the following values:

  • uninitialized - has not started loading yet
  • loading - is loading
  • interactive - has been loaded, The document and the user can start interacting
  • complete - loading completed

Syntax

document.readyState


Browser support

QQ截图20161108165429.png

All major browsers support the readyState attribute

Examples

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>

载入状态:
<script>
document.write(document.readyState);
</script>

</body>
</html>

Run Instance»

Click the "Run Instance" button to view the online instance