blob: 9a4d2ac6fda3abadae7c97fc3dd7a39d7e7e3422 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001define( [
2 "../ajax"
3], function( jQuery ) {
4
5"use strict";
6
7jQuery._evalUrl = function( url, options ) {
8 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 ) {
25 jQuery.globalEval( response, options );
26 }
27 } );
28};
29
30return jQuery._evalUrl;
31
32} );