Return to Test Drive Home

DOMContentLoaded

The DOMContentLoaded event fires when parsing of the current page is complete; the load event fires when all files have finished loading from all resources, including ads and images. DOMContentLoaded is a great event to use to hookup UI functionality to complex web pages.

When each event fires, the word "DONE!" is printed to the screen.

"DOMContentLoaded"
Waiting...
Difference:
--
"load"
Waiting...

The > 500K image above should delay the load event, but not the DOMContentLoaded event