5 ], function( jQuery, document ) {
7 // Install script dataType
10 script: "text/javascript, application/javascript, " +
11 "application/ecmascript, application/x-ecmascript"
14 script: /\b(?:java|ecma)script\b/
17 "text script": function( text ) {
18 jQuery.globalEval( text );
24 // Handle cache's special case and crossDomain
25 jQuery.ajaxPrefilter( "script", function( s ) {
26 if ( s.cache === undefined ) {
29 if ( s.crossDomain ) {
34 // Bind script tag hack transport
35 jQuery.ajaxTransport( "script", function( s ) {
37 // This transport only deals with cross domain requests
38 if ( s.crossDomain ) {
41 send: function( _, complete ) {
42 script = jQuery( "<script>" ).prop( {
43 charset: s.scriptCharset,
47 callback = function( evt ) {
51 complete( evt.type === "error" ? 404 : 200, evt.type );
56 // Use native DOM manipulation to avoid our domManip AJAX trickery
57 document.head.appendChild( script[ 0 ] );