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
active_record_survey_api-0.0.17 spec/test_app/vendor/assets/bower_components/jquery/src/ajax/script.js
active_record_survey_api-0.0.14 spec/test_app/vendor/assets/bower_components/jquery/src/ajax/script.js
abstracted-0.4.13 vendor/assets/components/jquery/src/ajax/script.js
kms-0.6.0 vendor/assets/bower_components/jquery/src/ajax/script.js
unpoly-rails-0.31.2 spec_app/vendor/assets/bower_components/jquery/src/ajax/script.js
unpoly-rails-0.31.1 spec_app/vendor/assets/bower_components/jquery/src/ajax/script.js
trusty-festivity-extension-2.5.19 vendor/assets/components/jquery/src/ajax/script.js
middleman-core-4.1.11 fixtures/import-app/bower_components/jquery/src/ajax/script.js
trusty-festivity-extension-2.5.18 vendor/assets/components/jquery/src/ajax/script.js
trusty-festivity-extension-2.5.17 vendor/assets/components/jquery/src/ajax/script.js
date_picker-0.0.9 test/dummy/vendor/assets/components/jquery/src/ajax/script.js
unpoly-rails-0.31.0 spec_app/vendor/assets/bower_components/jquery/src/ajax/script.js
abstracted-0.4.12 vendor/assets/components/jquery/src/ajax/script.js
catscope-0.1.3 assets/bower_components/jquery/src/ajax/script.js
catscope-0.1.2 assets/bower_components/jquery/src/ajax/script.js
trusty-festivity-extension-2.5.16 vendor/assets/components/jquery/src/ajax/script.js
unpoly-rails-0.30.1 spec_app/vendor/assets/bower_components/jquery/src/ajax/script.js
trusty-festivity-extension-2.5.15 vendor/assets/components/jquery/src/ajax/script.js
trusty-festivity-extension-2.5.14 vendor/assets/components/jquery/src/ajax/script.js
trusty-festivity-extension-2.5.13 vendor/assets/components/jquery/src/ajax/script.js