diff options
author | David Serduke <davidserduke@gmail.com> | 2007-12-10 19:04:59 +0000 |
---|---|---|
committer | David Serduke <davidserduke@gmail.com> | 2007-12-10 19:04:59 +0000 |
commit | 9ea8017f86c48ab624fbdc0e55a79110d9c61a9f (patch) | |
tree | 506dfe2f190badcb0b9aca321a0038b79e49bd2f /src | |
parent | f97f77c034dc62001a687c728bdfdc71a23bf6b8 (diff) | |
download | jquery-9ea8017f86c48ab624fbdc0e55a79110d9c61a9f.tar.gz jquery-9ea8017f86c48ab624fbdc0e55a79110d9c61a9f.zip |
Fixed #1959 by postponing ALL script evaluations till the html insertion is done. Before the code would immediately execute any scripts that weren't in subelements if no subelements prior had scripts in them (i.e. once any script was postponed they all were). This could cause inconsistent behavior. Since, at this time, we have to postpone some scripts it makes more sense to postpone them all.
Diffstat (limited to 'src')
-rw-r--r-- | src/core.js | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/core.js b/src/core.js index 39ffdb580..582e53e7c 100644 --- a/src/core.js +++ b/src/core.js @@ -494,16 +494,9 @@ jQuery.fn = jQuery.prototype = { this.cloneNode( true ) : this; + // execute all scripts after the elements have been injected if ( jQuery.nodeName( elem, "script" ) ) { - - // If scripts are waiting to be executed, wait on this script as well - if ( scripts.length ) - scripts = scripts.add( elem ); - - // If nothing is waiting to be executed, run immediately - else - evalScript( 0, elem ); - + scripts = scripts.add( elem ); } else { // Remove any inner scripts for later evaluation if ( elem.nodeType == 1 ) |