Make sure that if an additional load event is triggered (such as an iframe being dynamically injected in DOM ready) the ready event isn't triggered twice. Fixes #7352.
This commit is contained in:
parent
aa74396976
commit
983548f8eb
11
src/core.js
11
src/core.js
|
@ -417,13 +417,15 @@ jQuery.extend({
|
||||||
// If there are functions bound, to execute
|
// If there are functions bound, to execute
|
||||||
if ( readyList ) {
|
if ( readyList ) {
|
||||||
// Execute all of them
|
// Execute all of them
|
||||||
var fn, i = 0;
|
var fn,
|
||||||
while ( (fn = readyList[ i++ ]) ) {
|
i = 0,
|
||||||
fn.call( document, jQuery );
|
ready = readyList;
|
||||||
}
|
|
||||||
|
|
||||||
// Reset the list of functions
|
// Reset the list of functions
|
||||||
readyList = null;
|
readyList = null;
|
||||||
|
|
||||||
|
while ( (fn = ready[ i++ ]) ) {
|
||||||
|
fn.call( document, jQuery );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger any bound ready events
|
// Trigger any bound ready events
|
||||||
|
@ -431,6 +433,7 @@ jQuery.extend({
|
||||||
jQuery( document ).trigger( "ready" ).unbind( "ready" );
|
jQuery( document ).trigger( "ready" ).unbind( "ready" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
bindReady: function() {
|
bindReady: function() {
|
||||||
|
|
Loading…
Reference in a new issue