5 ], function( jQuery, document ) {
9 // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
10 jQuery.ajaxPrefilter( function( s ) {
11 if ( s.crossDomain ) {
12 s.contents.script = false;
16 // Install script dataType
19 script: "text/javascript, application/javascript, " +
20 "application/ecmascript, application/x-ecmascript"
23 script: /\b(?:java|ecma)script\b/
26 "text script": function( text ) {
27 jQuery.globalEval( text );
33 // Handle cache's special case and crossDomain
34 jQuery.ajaxPrefilter( "script", function( s ) {
35 if ( s.cache === undefined ) {
38 if ( s.crossDomain ) {
43 // Bind script tag hack transport
44 jQuery.ajaxTransport( "script", function( s ) {
46 // This transport only deals with cross domain requests
47 if ( s.crossDomain ) {
50 send: function( _, complete ) {
51 script = jQuery( "<script>" ).prop( {
52 charset: s.scriptCharset,
56 callback = function( evt ) {
60 complete( evt.type === "error" ? 404 : 200, evt.type );
65 // Use native DOM manipulation to avoid our domManip AJAX trickery
66 document.head.appendChild( script[ 0 ] );