1document.addEventListener("DOMContentLoaded", theDomHasLoaded, false);
2window.addEventListener("load", pageFullyLoaded, false);
3
4function theDomHasLoaded(e) {
5 // do something
6}
7
8function pageFullyLoaded(e) {
9 // do something again
10}