Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MooTools: domready vs load

With which will function(){} fire first?

A) window.addEvent('domready', function(){});
B) window.addEvent('load', function(){});
like image 925
JamesBrownIsDead Avatar asked Nov 04 '09 21:11

JamesBrownIsDead


2 Answers

domready will fire first.

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

like image 176
Björn Avatar answered Nov 28 '22 18:11

Björn


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

like image 21
The Web Savant Avatar answered Nov 28 '22 16:11

The Web Savant