]> source.dussan.org Git - jquery.git/commitdiff
Make sure that if an additional load event is triggered (such as an iframe being...
authorJohn Resig <jeresig@gmail.com>
Tue, 9 Nov 2010 18:44:06 +0000 (13:44 -0500)
committerJohn Resig <jeresig@gmail.com>
Tue, 9 Nov 2010 18:44:06 +0000 (13:44 -0500)
src/core.js

index 8940ada2bdf37aec3a7296d2dc38ccb852c5c27e..9e1bfc67fbe0986a4eac88d43e23e81cd9f127f5 100644 (file)
@@ -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" );
+                               }
                        }
                }
        },