As asked in the title, what's the first event fired when a Web page is loaded to the browser? I believe there are events before window.onload. What are they, and which one is the first fired?
+1
A:
If you're looking to invoke an event handler before onload
, DOMContentLoaded
is one event that usually fires before.
document.addEventListener('DOMContentLoaded', functionRef, false);
meder
2010-07-23 04:48:32
Not supported in IE tho right?
jasongetsdown
2010-07-23 05:08:32
A:
Don't know if this helps but firebug/IE Dev Tool is really good for watching JS events execute as the page loads. I use that to caputre events and see the order of how they're happening.
Mike Sav
2010-09-09 15:11:14