diff options
author | John Resig <jeresig@gmail.com> | 2009-01-05 22:58:02 +0000 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2009-01-05 22:58:02 +0000 |
commit | 18229390005fc3aa43e290ae53eb3775f3ff10cb (patch) | |
tree | 57e32bec1f70a44fa618ff5cec8c9803dbfb1d76 | |
parent | 45b3a884d55ce6004f7cec3fd27b42198b147ceb (diff) | |
download | jquery-18229390005fc3aa43e290ae53eb3775f3ff10cb.tar.gz jquery-18229390005fc3aa43e290ae53eb3775f3ff10cb.zip |
Switched back to the old style of running embedded scripts (users who have duplicate runs will
have to deal with it another way).
-rw-r--r-- | src/core.js | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/core.js b/src/core.js index 9222e0a12..ad94ce10c 100644 --- a/src/core.js +++ b/src/core.js @@ -894,15 +894,6 @@ jQuery.extend({ if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); - if ( fragment ) { - var found = div.getElementsByTagName("script"); - - while ( found.length ) { - scripts.push( found[0] ); - found[0].parentNode.removeChild( found[0] ); - } - } - elem = jQuery.makeArray( div.childNodes ); } @@ -915,14 +906,12 @@ jQuery.extend({ if ( fragment ) { for ( var i = 0; ret[i]; i++ ) { - var node = ret[i]; - if ( jQuery.nodeName( node, "script" ) ) { - if( node.parentNode ) - node.parentNode.removeChild( node ); + if ( jQuery.nodeName( ret[i], "script" ) ) { + scripts.push( ret[i].parentNode.removeChild( ret[i] ) ); } else { - if ( node.nodeType === 1 ) - ret = jQuery.merge( ret, node.getElementsByTagName("script")); - fragment.appendChild( node ); + if ( ret[i].nodeType === 1 ) + ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); + fragment.appendChild( ret[i] ); } } |