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.

This commit is contained in:
David Serduke 2007-12-10 19:04:59 +00:00
parent f97f77c034
commit 9ea8017f86
2 changed files with 4 additions and 10 deletions

View file

@ -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 )