Skip to content
Permalink
Browse files

Fix #10753. Inline evalScript as it's only used in one place

  • Loading branch information...
mikesherov authored and dmethvin committed Dec 9, 2011
1 parent e452ebd commit 07866a04ddcac0b912cd0a7e382fea8667b32d0e
Showing with 15 additions and 17 deletions.
  1. +15 −17 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 );

0 comments on commit 07866a0

Please sign in to comment.
You can’t perform that action at this time.