Possible Duplicate:
Difference between DOMContentLoaded and Load events
Whats the difference between
window.addEventListener("load", load, false);
and
document.addEventListener("DOMContentLoaded", load, false);
?
Possible Duplicate:
Difference between DOMContentLoaded and Load events
Whats the difference between
window.addEventListener("load", load, false);
and
document.addEventListener("DOMContentLoaded", load, false);
?
DOMContentLoaded awaits only for HTML and scripts to be loaded.
window.onload and iframe.onload triggers when the page is fully loaded with all dependent resources including images and styles.
Here is more details you can find http://javascript.info/tutorial/onload-ondomcontentloaded