scratch
/bower_components/jquery/src/ajax/script.js |
@@ -1,26 +1,15 @@ |
define( [ |
define([ |
"../core", |
"../var/document", |
"../ajax" |
], function( jQuery, document ) { |
], function( jQuery ) { |
|
"use strict"; |
|
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) |
jQuery.ajaxPrefilter( function( s ) { |
if ( s.crossDomain ) { |
s.contents.script = false; |
} |
} ); |
|
// Install script dataType |
jQuery.ajaxSetup( { |
jQuery.ajaxSetup({ |
accepts: { |
script: "text/javascript, application/javascript, " + |
"application/ecmascript, application/x-ecmascript" |
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" |
}, |
contents: { |
script: /\b(?:java|ecma)script\b/ |
script: /(?:java|ecma)script/ |
}, |
converters: { |
"text script": function( text ) { |
@@ -28,7 +17,7 @@ |
return text; |
} |
} |
} ); |
}); |
|
// Handle cache's special case and crossDomain |
jQuery.ajaxPrefilter( "script", function( s ) { |
@@ -38,20 +27,20 @@ |
if ( s.crossDomain ) { |
s.type = "GET"; |
} |
} ); |
}); |
|
// Bind script tag hack transport |
jQuery.ajaxTransport( "script", function( s ) { |
|
// This transport only deals with cross domain requests |
if ( s.crossDomain ) { |
var script, callback; |
return { |
send: function( _, complete ) { |
script = jQuery( "<script>" ).prop( { |
script = jQuery("<script>").prop({ |
async: true, |
charset: s.scriptCharset, |
src: s.url |
} ).on( |
}).on( |
"load error", |
callback = function( evt ) { |
script.remove(); |
@@ -61,8 +50,6 @@ |
} |
} |
); |
|
// Use native DOM manipulation to avoid our domManip AJAX trickery |
document.head.appendChild( script[ 0 ] ); |
}, |
abort: function() { |
@@ -72,6 +59,6 @@ |
} |
}; |
} |
} ); |
}); |
|
} ); |
}); |