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?
If you're looking to invoke an event handler before onload
, DOMContentLoaded
is one event that usually fires before.
document.addEventListener('DOMContentLoaded', functionRef, false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With