Manipulation: Restore _evalUrl jQuery.ajax calls to dataType: script
[jquery.git] / src / manipulation / _evalUrl.js
blobe20995a8971cef3cd05c2ef5a645b3362dff3005
1 define( [
2 "../ajax"
3 ], function( jQuery ) {
5 "use strict";
7 jQuery._evalUrl = function( url ) {
8 return jQuery.ajax( {
9 url: url,
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,
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() {}
24 dataFilter: function( response ) {
25 jQuery.globalEval( response );
27 } );
30 return jQuery._evalUrl;
32 } );