diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2011-12-08 21:27:05 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-12-08 21:27:05 -0500 |
commit | 07866a04ddcac0b912cd0a7e382fea8667b32d0e (patch) | |
tree | 654826918290ae7f4cb7c415c6d6b44a796501f9 /src | |
parent | e452ebd76dc0ee0e85c176bf4105e0afa77f9a34 (diff) | |
download | jquery-07866a04ddcac0b912cd0a7e382fea8667b32d0e.tar.gz jquery-07866a04ddcac0b912cd0a7e382fea8667b32d0e.zip |
Fix #10753. Inline evalScript as it's only used in one place
Diffstat (limited to 'src')
-rw-r--r-- | src/manipulation.js | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 5715a905d..d1100f7f8 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -348,7 +348,21 @@ jQuery.fn.extend({ } if ( scripts.length ) { - jQuery.each( scripts, evalScript ); + jQuery.each( scripts, function( i, elem ) { + if ( elem.src ) { + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + } else { + jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); + } + + if ( elem.parentNode ) { + elem.parentNode.removeChild( elem ); + } + }); } } @@ -789,20 +803,4 @@ jQuery.extend({ } }); -function evalScript( i, elem ) { - if ( elem.src ) { - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - } else { - jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) ); - } - - if ( elem.parentNode ) { - elem.parentNode.removeChild( elem ); - } -} - })( jQuery ); |