-jQuery.extend(jQuery.xhr, {
-
- // Add new prefilter
- prefilter: function (functor) {
- if ( isFunction(functor) ) {
- jQuery.ajaxSettings.prefilters.push( functor );
- }
- return this;
- },
-
- // Bind a transport to one or more dataTypes
- bindTransport: function () {
-
- var args = arguments,
- i,
- start = 0,
- length = args.length,
- dataTypes = [ "*" ],
- functors = [],
- functor,
- first,
- append,
- list,
- transports = jQuery.ajaxSettings.transports;
-
- if ( length ) {
-
- if ( ! isFunction( args[ 0 ] ) ) {
-
- dataTypes = args[ 0 ].toLowerCase().split(/\s+/);
- start = 1;
-
- }
-
- if ( dataTypes.length && start < length ) {
-
- for ( i = start; i < length; i++ ) {
- functor = args[i];
- if ( isFunction(functor) ) {
- functors.push( functor );
- }
- }
-
- if ( functors.length ) {
-
- jQuery.each ( dataTypes, function( _ , dataType ) {
-
- first = /^\+/.test( dataType );
-
- if (first) {
- dataType = dataType.substr(1);
- }
-
- if ( dataType !== "" ) {
-
- append = Array.prototype[ first ? "unshift" : "push" ];
-
- list = transports[ dataType ];
-
- jQuery.each ( functors, function( _ , functor ) {
-
- if ( ! list ) {
-
- list = transports[ dataType ] = [ functor ];
-
- } else {
-
- append.call( list , functor );
- }
- } );
- }
-
- } );
- }
- }
- }
-
- return this;
- }
-
-
-});
-
-// Select a transport given options
-function selectTransport( s ) {