From c2026b117d1ca5b2e42a52c7e2a8ae8988cf0d4b Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Wed, 12 Dec 2018 11:21:24 -0500 Subject: Manipulation: Only evaluate HTTP-successful script src Fixes gh-4126 Closes gh-4243 --- src/manipulation/_evalUrl.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/manipulation/_evalUrl.js') diff --git a/src/manipulation/_evalUrl.js b/src/manipulation/_evalUrl.js index f9ec7027c..1ed033673 100644 --- a/src/manipulation/_evalUrl.js +++ b/src/manipulation/_evalUrl.js @@ -10,11 +10,16 @@ jQuery._evalUrl = function( url ) { // Make this explicit, since user can override this through ajaxSetup (#11264) type: "GET", - dataType: "script", + dataType: "text", cache: true, async: false, global: false, - "throws": true + "throws": true, + + // Only evaluate the response if it is successful (gh-4126) + success: function( text ) { + jQuery.globalEval( text ); + } } ); }; -- cgit v1.2.3