ready-state
Get / Check the document readyState by Promise
readystatechange
Check when the DOM is loaded likeDOMContentLoaded
Check when the Window is loaded likeonload
All checks also work even after the DOM was loaded.
Dependencies
none!
Install
$ npm i ready-state
$ yarn add ready-state
Usage
const readyState = ; readyStateloading readyStateinteractive readyStateload readyStatewindow readyStatecomplete readyStatedomready readyStatedom console; console;
Test result
✔ all document states should pass ℹ readyStateloading ℹ readyStateinteractive ℹ readyStateload ℹ readyState ℹ readyStatecomplete ℹ readyStatedomready ℹ readyState 1 test passed
Related
- element-ready - Detect when an element is ready in the DOM
License
MIT © Sönke Kluth