How to detect if DOMContentLoaded was fired
For seeing if all resources in the page have been loaded: if (document.readyState === “complete” || document.readyState === “loaded”) { // document is already ready to go } This has been supported in IE and webkit for a long time. It was added to Firefox in 3.6. Here’s the spec. “loaded” is for older Safari … Read more