The easiest solution might be checking for document.readyState == 'complete'
, see http://www.w3schools.com/jsref/prop_doc_readystate.asp
More Related Contents:
- event.preventDefault() vs. return false
- Why is setState in reactjs Async instead of Sync?
- How can I trigger a JavaScript event click
- The value of “this” within the handler using addEventListener
- What exactly is the parameter e (event) and why pass it to JavaScript functions?
- How do I chain three asynchronous calls using jQuery promises?
- Execute write on doc: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
- Intercept page exit event
- React onClick function fires on render
- Reading client side text file using Javascript
- Node JS Promise.all and forEach
- How to write asynchronous functions for Node.js
- node.js async/await using with MySQL
- Enter key press behaves like a Tab in Javascript
- jQuery – Can threads/asynchronous be done?
- Detect mousemove when over an iframe?
- Use Async/Await with Axios in React.js
- How to detect in iOS webapp when switching back to Safari from background?
- Do Javascript promises block the stack
- Remove key press delay in Javascript
- Event Capturing vs Event Bubbling [duplicate]
- Detecting an image 404 in Javascript
- Emulate jQuery “on” with selector in pure Javascript
- visibilitychange event is not triggered when switching program/window with ALT+TAB or clicking in taskbar
- Is dispatchEvent a sync or an async function
- onclick event function in JavaScript
- Keycode is always zero in Chrome for Android
- Capturing result of window.onbeforeunload confirmation dialog
- Load javascript async, then check DOM loaded before executing callback
- Replacement for deprecated `keypress` DOM event