Sha256: 2b5d691c1dba63f633e9a0089da518e548b43f9a3954710a2251afc0c8777820

Contents?: true

Size: 1.35 KB

Versions: 157

Compression:

Stored size: 1.35 KB

Contents

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

// 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 requests
	if ( s.crossDomain ) {
		var script, callback;
		return {
			send: function( _, complete ) {
				script = jQuery( "<script>" ).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

157 entries across 100 versions & 10 rubygems

Version Path
epuber-0.10.3 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.10.2 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.10.1 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.9.3 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.9.2 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.9.1 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.9.0 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.8.0 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.7.4 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.7.3 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.7.2 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.7.1 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
epuber-0.7.0 lib/epuber/third_party/bower/bower_components/jquery/src/ajax/script.js
jekyll-theme-pirati-7.7.1 _sass/foundation-sites/vendor/jquery/src/ajax/script.js
jekyll-theme-pirati-7.7.1 _sass/foundation-sites/node_modules/jquery/src/ajax/script.js
jekyll-theme-pirati-7.7.0 _sass/foundation-sites/node_modules/jquery/src/ajax/script.js
jekyll-theme-pirati-7.7.0 _sass/foundation-sites/vendor/jquery/src/ajax/script.js
jekyll-theme-pirati-7.6.2 _sass/foundation-sites/vendor/jquery/src/ajax/script.js
jekyll-theme-pirati-7.6.2 _sass/foundation-sites/node_modules/jquery/src/ajax/script.js
jekyll-theme-pirati-7.6.1 _sass/foundation-sites/vendor/jquery/src/ajax/script.js