Skip to content

Commit

Permalink
Fix #10753. Inline evalScript as it's only used in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesherov authored and dmethvin committed Dec 9, 2011
1 parent e452ebd commit 07866a0
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/manipulation.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -348,7 +348,21 @@ jQuery.fn.extend({
} }


if ( scripts.length ) { 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 );
}
});
} }
} }


Expand Down Expand Up @@ -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 ); })( jQuery );

0 comments on commit 07866a0

Please sign in to comment.