views:

155

answers:

2

Hi all,

What is the difference between the DOMContentLoaded and the Load event?

thx, Viktor

+2  A: 

From the Mozilla Developer Center:

Fired on a Window object when a document's DOM content is finished loading, but unlike "load", does not wait until all images are loaded.

Simon Lieschke
+1  A: 

The DOMContentLoaded event will fire as soon as the DOM hierarchy has been fully constructed, the load event will do it when all the images and sub-frames have finished loading.

This event will work on most modern browsers, but not on IE, there are some workarounds to mimic this event on IE, like the used on the jQuery library, they attach the IE specific onreadystatechange event.

CMS