MooTools: domready vs load
Asked Answered
C

2

5

With which will function(){} fire first?

A) window.addEvent('domready', function(){});
B) window.addEvent('load', function(){});
Chelate answered 4/11, 2009 at 21:2 Comment(0)
U
12

domready will fire first.

http://demos111.mootools.net/DomReadyVS.Load

Undulate answered 4/11, 2009 at 21:3 Comment(3)
sometimes it fires too soon in IE with 1.11, i have been forced to use load instead.Oscitant
@Chelate -- the concept of the domready event is that the structure of the html and the resulting DOM (document object model) will have loaded. So, the "skeleton" of the page has loaded. While load is the event that fires once all that is done AS WELL AS all the images and whatever other ancillary content files.Lasagne
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.Williswillison
T
2

domready comes first as load waits till everything on the page is loaded before executing.

Toxemia answered 3/12, 2009 at 15:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.