X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=event%2Fevent.js;h=5511b351e2e4898c3d27fdf998c49b118fd384d2;hb=9e27d8d1b4d5a93ef4107aab5e815a2c24ed899d;hp=70111c61bca5c2368c1a1f4cf8e1b9a0fdbb8e9b;hpb=55370e571081930d99128e71bae4fdb5f025b558;p=jquery.git diff --git a/event/event.js b/event/event.js index 70111c6..5511b35 100644 --- a/event/event.js +++ b/event/event.js @@ -41,8 +41,12 @@ $.fn.hover = function(f,g) { }); }; +$.$$isReady = false; +$.$$ready = []; + // Handle when the DOM is ready -$.ready = function(isFinal) { +$.ready = function() { + $.$$isReady = true; if ( $.$$ready ) { for ( var i = 0; i < $.$$ready.length; i++ ) { $.apply( document, $.$$ready[i] ); @@ -51,27 +55,28 @@ $.ready = function(isFinal) { } }; -// Based off of: -// http://linguiste.org/projects/behaviour-DOMContentLoaded/example.html - // If Mozilla is used if ( $.browser == "mozilla" ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", $.ready, null ); -// If IE is used +// If IE is used, use the excellent hack by Matthias Miller +// http://www.outofhanwell.com/blog/index.php?title=the_window_onload_problem_revisited } else if ( $.browser == "msie" ) { + + // Only works if you document.write() it + document.write('