mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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
19
src/core.js
19
src/core.js
@ -417,18 +417,21 @@ 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;
|
||||||
}
|
|
||||||
|
|
||||||
// Trigger any bound ready events
|
while ( (fn = ready[ i++ ]) ) {
|
||||||
if ( jQuery.fn.trigger ) {
|
fn.call( document, jQuery );
|
||||||
jQuery( document ).trigger( "ready" ).unbind( "ready" );
|
}
|
||||||
|
|
||||||
|
// Trigger any bound ready events
|
||||||
|
if ( jQuery.fn.trigger ) {
|
||||||
|
jQuery( document ).trigger( "ready" ).unbind( "ready" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user