Sha256: f774f1efb91a6fee17f062e2ca32e1f5a1a8349d12801733130db2e6945e3e95

Contents?: true

Size: 1.6 KB

Versions: 41

Compression:

Stored size: 1.6 KB

Contents

define( [
	"../core",
	"../var/document",
	"../ajax"
], function( jQuery, document ) {

"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( {
	accepts: {
		script: "text/javascript, application/javascript, " +
			"application/ecmascript, application/x-ecmascript"
	},
	contents: {
		script: /\b(?:java|ecma)script\b/
	},
	converters: {
		"text script": function( text ) {
			jQuery.globalEval( text );
			return text;
		}
	}
} );

// Handle cache's special case and crossDomain
jQuery.ajaxPrefilter( "script", function( s ) {
	if ( s.cache === undefined ) {
		s.cache = false;
	}
	if ( s.crossDomain ) {
		s.type = "GET";
	}
} );

// Bind script tag hack transport
jQuery.ajaxTransport( "script", function( s ) {

	// This transport only deals with cross domain or forced-by-attrs requests
	if ( s.crossDomain || s.scriptAttrs ) {
		var script, callback;
		return {
			send: function( _, complete ) {
				script = jQuery( "<script>" )
					.attr( s.scriptAttrs || {} )
					.prop( { charset: s.scriptCharset, src: s.url } )
					.on( "load error", callback = function( evt ) {
						script.remove();
						callback = null;
						if ( evt ) {
							complete( evt.type === "error" ? 404 : 200, evt.type );
						}
					} );

				// Use native DOM manipulation to avoid our domManip AJAX trickery
				document.head.appendChild( script[ 0 ] );
			},
			abort: function() {
				if ( callback ) {
					callback();
				}
			}
		};
	}
} );

} );

Version data entries

41 entries across 32 versions & 6 rubygems

Version Path
trusty-cms-6.3.1 node_modules/jquery-treetable/node_modules/jquery/src/ajax/script.js
trusty-cms-6.3.1 node_modules/jquery/src/ajax/script.js
trusty-cms-6.3.1 node_modules/jquery-ujs/node_modules/jquery/src/ajax/script.js
optimacms-0.1.61 spec/dummy/node_modules/cocoon-js/node_modules/jquery/src/ajax/script.js
optimacms-0.1.61 spec/dummy/node_modules/jquery-ujs/node_modules/jquery/src/ajax/script.js
udt-itf-theme-0.1.0 _sass/node_modules/jquery/src/ajax/script.js
trusty-cms-5.0.7 node_modules/jquery/src/ajax/script.js
trusty-cms-5.0.6 node_modules/jquery/src/ajax/script.js
trusty-cms-5.0.5 node_modules/jquery/src/ajax/script.js
trusty-cms-5.0.4 node_modules/jquery/src/ajax/script.js
trusty-cms-5.0.3 node_modules/jquery/src/ajax/script.js
trusty-cms-5.0.2 node_modules/jquery/src/ajax/script.js
trusty-cms-5.0.1 node_modules/jquery/src/ajax/script.js
trusty-cms-4.3.5 node_modules/jquery/src/ajax/script.js
trusty-cms-5.0.0 node_modules/jquery/src/ajax/script.js
trusty-cms-4.3.4 node_modules/jquery/src/ajax/script.js
trusty-cms-4.3.4 spec/dummy/node_modules/jquery/src/ajax/script.js
trusty-cms-4.3.3 spec/dummy/node_modules/jquery/src/ajax/script.js
trusty-cms-4.3.3 node_modules/jquery/src/ajax/script.js
trusty-cms-4.3.2 spec/dummy/node_modules/jquery/src/ajax/script.js