Sha256: 869ecf70293309bfc1f0a01f24f9534fd5bad0657180489f2e3d33c6d2e486fb

Contents?: true

Size: 1.24 KB

Versions: 565

Compression:

Stored size: 1.24 KB

Contents

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

// Install script dataType
jQuery.ajaxSetup({
	accepts: {
		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
	},
	contents: {
		script: /(?:java|ecma)script/
	},
	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 requests
	if ( s.crossDomain ) {
		var script, callback;
		return {
			send: function( _, complete ) {
				script = jQuery("<script>").prop({
					async: true,
					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 );
						}
					}
				);
				document.head.appendChild( script[ 0 ] );
			},
			abort: function() {
				if ( callback ) {
					callback();
				}
			}
		};
	}
});

});

Version data entries

565 entries across 565 versions & 41 rubygems

Version Path
card-1.93.12 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.11 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.10 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.9 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.8 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.7 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.6 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.5 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.4 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.3 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
iqvoc-4.12.0 vendor/assets/bower_components/jquery/src/ajax/script.js
epuber-0.4.0 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
card-1.93.2 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/src/ajax/script.js
card-1.93.1 mod/bootstrap/vendor/bootswatch/3/bower_components/jquery/src/ajax/script.js
abstracted-0.4.20 vendor/assets/components/jquery/src/ajax/script.js
abstracted-0.4.19 vendor/assets/components/jquery/src/ajax/script.js
abstracted-0.4.18 vendor/assets/components/jquery/src/ajax/script.js
catscope-0.1.4 assets/bower_components/jquery/src/ajax/script.js
kms-0.9.0 vendor/assets/bower_components/jquery/src/ajax/script.js
iqvoc-4.11.1 vendor/assets/bower_components/jquery/src/ajax/script.js