🌐 AI搜索 & 代理 主页
Skip to content

Commit 13de7c9

Browse files
authored
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
1 parent c2026b1 commit 13de7c9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/manipulation/_evalUrl.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ jQuery._evalUrl = function( url ) {
1010

1111
// Make this explicit, since user can override this through ajaxSetup (#11264)
1212
type: "GET",
13-
dataType: "text",
13+
dataType: "script",
1414
cache: true,
1515
async: false,
1616
global: false,
17-
"throws": true,
1817

1918
// Only evaluate the response if it is successful (gh-4126)
20-
success: function( text ) {
21-
jQuery.globalEval( text );
19+
// dataFilter is not invoked for failure responses, so using it instead
20+
// of the default converter is kludgy but it works.
21+
converters: {
22+
"text script": function() {}
23+
},
24+
dataFilter: function( response ) {
25+
jQuery.globalEval( response );
2226
}
2327
} );
2428
};

0 commit comments

Comments
 (0)