aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation/_evalUrl.js
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2018-12-12 11:21:24 -0500
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2018-12-12 17:21:24 +0100
commitc2026b117d1ca5b2e42a52c7e2a8ae8988cf0d4b (patch)
treed90523792dd58825c1dc50c0a89080a5192078d9 /src/manipulation/_evalUrl.js
parent4ffb1df8e4738eb86bde429ec20efc7394e5e497 (diff)
downloadjquery-c2026b117d1ca5b2e42a52c7e2a8ae8988cf0d4b.tar.gz
jquery-c2026b117d1ca5b2e42a52c7e2a8ae8988cf0d4b.zip
Manipulation: Only evaluate HTTP-successful script src
Fixes gh-4126 Closes gh-4243
Diffstat (limited to 'src/manipulation/_evalUrl.js')
-rw-r--r--src/manipulation/_evalUrl.js9
1 files changed, 7 insertions, 2 deletions
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 );
+ }
} );
};