Skip to content

Commit

Permalink
Don't use a local copy of jQuery.ajaxSettings.isLocal anymore but use…
Browse files Browse the repository at this point in the history
… the current value so that it is possible to set isLocal to true for protocols unknown to jQuery.
  • Loading branch information
jaubourg committed Feb 3, 2011
1 parent 0736db6 commit 4d808a3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/ajax/xhr.js
Expand Up @@ -23,11 +23,7 @@ var // Next active xhr id
xhrUnloadAbortInstalled,

// XHR used to determine supports properties
testXHR,

// Keep track of isLocal in case it gets removed
// from ajaxSettings later on
protocolIsLocal = jQuery.ajaxSettings.isLocal;
testXHR;

// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
Expand All @@ -38,12 +34,9 @@ jQuery.ajaxSettings.xhr = window.ActiveXObject ?
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
( protocolIsLocal ?
createActiveXHR :
function() {
return createStandardXHR() || createActiveXHR();
}
) :
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;

Expand Down Expand Up @@ -196,7 +189,7 @@ if ( jQuery.support.ajax ) {
status = 302;
}
// All same-domain: for local files, 0 is a success
} else if( protocolIsLocal ) {
} else if( s.isLocal ) {
status = 200;
// Opera: this notifies success for all requests
// (verified in 11.01). Patch welcome.
Expand Down

0 comments on commit 4d808a3

Please sign in to comment.