aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2018-12-13 12:54:39 -0500
committerGitHub <noreply@github.com>2018-12-13 12:54:39 -0500
commit13de7c9ede1c49c30344b4347985eac341484b1e (patch)
tree72dabf0bbbe40525855f679afbac8b47a3627e1d /src
parentc2026b117d1ca5b2e42a52c7e2a8ae8988cf0d4b (diff)
downloadjquery-13de7c9ede1c49c30344b4347985eac341484b1e.tar.gz
jquery-13de7c9ede1c49c30344b4347985eac341484b1e.zip
Manipulation: Restore _evalUrl jQuery.ajax calls to dataType: script
IE and iOS <10 XHR transport does not succeed on data: URIs Ref gh-4243 Ref gh-4126 Closes gh-4258
Diffstat (limited to 'src')
-rw-r--r--src/manipulation/_evalUrl.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/manipulation/_evalUrl.js b/src/manipulation/_evalUrl.js
index 1ed033673..e20995a89 100644
--- a/src/manipulation/_evalUrl.js
+++ b/src/manipulation/_evalUrl.js
@@ -10,15 +10,19 @@ jQuery._evalUrl = function( url ) {
// Make this explicit, since user can override this through ajaxSetup (#11264)
type: "GET",
- dataType: "text",
+ dataType: "script",
cache: true,
async: false,
global: false,
- "throws": true,
// Only evaluate the response if it is successful (gh-4126)
- success: function( text ) {
- jQuery.globalEval( text );
+ // dataFilter is not invoked for failure responses, so using it instead
+ // of the default converter is kludgy but it works.
+ converters: {
+ "text script": function() {}
+ },
+ dataFilter: function( response ) {
+ jQuery.globalEval( response );
}
} );
};