diff --git a/src/core.js b/src/core.js index 39ffdb58..582e53e7 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 ) diff --git a/test/unit/core.js b/test/unit/core.js index 533fcef2..3aa66b32 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1022,7 +1022,8 @@ test("html(String)", function() { $("#main").html('foo
'); - $("#main").html("