Skip to content
Permalink
Browse files

Make sure that if an additional load event is triggered (such as an i…

…frame being dynamically injected in DOM ready) the ready event isn't triggered twice. Fixes #7352.
  • Loading branch information...
jeresig committed Nov 9, 2010
1 parent aa74396 commit 983548f8ebc3fcd1bb4600bc4b740cb8a5d4c48b
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/core.js
@@ -417,18 +417,21 @@ jQuery.extend({
// If there are functions bound, to execute
if ( readyList ) {
// Execute all of them
var fn, i = 0;
while ( (fn = readyList[ i++ ]) ) {
fn.call( document, jQuery );
}
var fn,
i = 0,
ready = readyList;

// Reset the list of functions
readyList = null;
}

// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger( "ready" ).unbind( "ready" );
while ( (fn = ready[ i++ ]) ) {
fn.call( document, jQuery );
}

// Trigger any bound ready events
if ( jQuery.fn.trigger ) {
jQuery( document ).trigger( "ready" ).unbind( "ready" );
}
}
}
},

0 comments on commit 983548f

Please sign in to comment.
You can’t perform that action at this time.