That the first event was fired when a web page was loaded into a browser

As indicated in the header, what was the first event that was fired when the webpage was loaded into the browser? I believe there are events before window.onload. What are they and who is the first to be fired?

+5
source share
3 answers

If you want to call the event handler before onload, DOMContentLoadedthis is one event that usually fires earlier.

document.addEventListener('DOMContentLoaded', functionRef, false);
+1
source

I don't know if this helps, but the firebug / IE Dev Tool is really good for viewing JS events when the page loads. I use this for caputre events and see how they happen.

0
source

All Articles