]> source.dussan.org Git - jquery.git/commitdiff
Manipulation: Restore _evalUrl jQuery.ajax calls to dataType: script
authorRichard Gibson <richard.gibson@gmail.com>
Thu, 13 Dec 2018 17:54:39 +0000 (12:54 -0500)
committerGitHub <noreply@github.com>
Thu, 13 Dec 2018 17:54:39 +0000 (12:54 -0500)
IE and iOS <10 XHR transport does not succeed on data: URIs
Ref gh-4243
Ref gh-4126
Closes gh-4258

src/manipulation/_evalUrl.js

index 1ed033673c7d02c57ee5601383e76c536d833d1a..e20995a8971cef3cd05c2ef5a645b3362dff3005 100644 (file)
@@ -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 );
                }
        } );
 };