Don't use a local copy of jQuery.ajaxSettings.isLocal anymore but use the current value so that it is possible to set isLocal to true for protocols unknown to jQuery.

This commit is contained in:
jaubourg 2011-02-03 18:22:37 +01:00
parent 0736db64a2
commit 4d808a3345

View file

@ -23,11 +23,7 @@ var // Next active xhr id
xhrUnloadAbortInstalled, xhrUnloadAbortInstalled,
// XHR used to determine supports properties // XHR used to determine supports properties
testXHR, testXHR;
// Keep track of isLocal in case it gets removed
// from ajaxSettings later on
protocolIsLocal = jQuery.ajaxSettings.isLocal;
// Create the request object // Create the request object
// (This is still attached to ajaxSettings for backward compatibility) // (This is still attached to ajaxSettings for backward compatibility)
@ -38,12 +34,9 @@ jQuery.ajaxSettings.xhr = window.ActiveXObject ?
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback. * we need a fallback.
*/ */
( protocolIsLocal ? function() {
createActiveXHR : return !this.isLocal && createStandardXHR() || createActiveXHR();
function() { } :
return createStandardXHR() || createActiveXHR();
}
) :
// For all other browsers, use the standard XMLHttpRequest object // For all other browsers, use the standard XMLHttpRequest object
createStandardXHR; createStandardXHR;
@ -196,7 +189,7 @@ if ( jQuery.support.ajax ) {
status = 302; status = 302;
} }
// All same-domain: for local files, 0 is a success // All same-domain: for local files, 0 is a success
} else if( protocolIsLocal ) { } else if( s.isLocal ) {
status = 200; status = 200;
// Opera: this notifies success for all requests // Opera: this notifies success for all requests
// (verified in 11.01). Patch welcome. // (verified in 11.01). Patch welcome.