From: John Resig Date: Sun, 18 Jun 2006 01:50:12 +0000 (+0000) Subject: Fixed the double-firing IE bug. (Ticket #13) X-Git-Tag: 1.0a~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5c7551e318050731f0afc5d07caea37ce679c5b3;p=jquery.git Fixed the double-firing IE bug. (Ticket #13) --- diff --git a/event/event.js b/event/event.js index a78e1a989..fcd590a1f 100644 --- a/event/event.js +++ b/event/event.js @@ -46,12 +46,14 @@ $.$$ready = []; // Handle when the DOM is ready $.ready = function() { - $.$$isReady = true; - if ( $.$$ready ) { - for ( var i = 0; i < $.$$ready.length; i++ ) { - $.apply( document, $.$$ready[i] ); + if ( !$.$$isReady ) { + $.$$isReady = true; + if ( $.$$ready ) { + for ( var i = 0; i < $.$$ready.length; i++ ) { + $.apply( document, $.$$ready[i] ); + } + $.$$ready = []; } - $.$$ready = []; } }; @@ -82,7 +84,7 @@ if ( $.browser == "mozilla" || $.browser == "opera" ) { // If Safari is used } else if ( $.browser == "safari" ) { $.$$timer = setInterval(function(){ - if ( document.readyState == "loaded" || + if ( document.readyState == "loaded" || document.readyState == "complete" ) { clearInterval( $.$$timer );