Skip to content

Commit

Permalink
Fixed the double-firing IE bug. (Ticket jquery#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Jun 18, 2006
1 parent c43e1e3 commit 5c7551e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions event/event.js
Expand Up @@ -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 = [];
}
};

Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 5c7551e

Please sign in to comment.