Build: Bump the github-actions group with 2 updates
[jquery.git] / src / manipulation / _evalUrl.js
blobe07bb8d72983886828f143c6ab15ea3b31d48213
1 import { jQuery } from "../ajax.js";
3 jQuery._evalUrl = function( url, options, doc ) {
4         return jQuery.ajax( {
5                 url: url,
7                 // Make this explicit, since user can override this through ajaxSetup (trac-11264)
8                 type: "GET",
9                 dataType: "script",
10                 cache: true,
11                 async: false,
12                 global: false,
13                 scriptAttrs: options.crossOrigin ? { "crossOrigin": options.crossOrigin } : undefined,
15                 // Only evaluate the response if it is successful (gh-4126)
16                 // dataFilter is not invoked for failure responses, so using it instead
17                 // of the default converter is kludgy but it works.
18                 converters: {
19                         "text script": function() {}
20                 },
21                 dataFilter: function( response ) {
22                         jQuery.globalEval( response, options, doc );
23                 }
24         } );