Mozila Firefox says that onreadystatechange
is an alternative to DOMContentLoaded
.
// alternative to DOMContentLoaded
document.onreadystatechange = function () {
if (document.readyState == "complete") {
initApplication();
}
}
In DOMContentLoaded
the Mozila's doc says:
The DOMContentLoaded event is fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading (the load event can be used to detect a fully-loaded page).
I think load
event should be used for a full document+resources loading.