3 ms·
Just for clarification, I was looking through Mozilla Developer network. There is no documented DOMContentReady event. There is a DOMContentLoaded [1] event wh
by MRSA 15y ago
Just for clarification,
I was looking through Mozilla Developer network.
There is no documented DOMContentReady event.
There is a DOMContentLoaded [1] event which is target at the document object. There is also a load [2] event fired at the window object. This is fired when the document is completely loaded.
jQuery.ready will use DOMContentLoaded and load as a backup. [3]
It is common for jQuery developers to shove their whole code base into the ready callback, which I imagine would slow a page down.
[1] https://developer.mozilla.org/en/Gecko-Specific_DOM_Events https://developer.mozilla.org/en/Gecko-Specific_DOM_Events
[2] https://developer.mozilla.org/en/DOM/window.onload https://developer.mozilla.org/en/DOM/window.onload
[3] https://github.com/jquery/jquery/blob/master/src/core.js https://github.com/jquery/jquery/blob/master/src/core.js