Aspects


vs


Domcontentloaded

DOM event The DOMContentLoaded event is fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading (the load event can be used to detect a fully-loaded page).

Onload

'onload' is a JavaScript event that is run when a document is loaded

Others

Quality Example
Event longer

"Sometimes it s preferable because onload event takes longer to fire then domcontentloaded"

from question "Element width is undefined on document ready"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0