blob: 6163b68c4e586a4e567b7862c023e264b8b9240b [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001define( [
2 "../ajax"
3], function( jQuery ) {
4
5"use strict";
6
Renovate botf591dcf2023-12-30 14:13:54 +00007jQuery._evalUrl = function( url, options, doc ) {
Copybara botbe50d492023-11-30 00:16:42 +01008 return jQuery.ajax( {
9 url: url,
10
11 // Make this explicit, since user can override this through ajaxSetup (#11264)
12 type: "GET",
13 dataType: "script",
14 cache: true,
15 async: false,
16 global: false,
17
18 // Only evaluate the response if it is successful (gh-4126)
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 ) {
Renovate botf591dcf2023-12-30 14:13:54 +000025 jQuery.globalEval( response, options, doc );
Copybara botbe50d492023-11-30 00:16:42 +010026 }
27 } );
28};
29
30return jQuery._evalUrl;
31
32} );