Fix #14475. Use IE11-friendly detect for proper XHR object.

We don't seem to have test cases for local file access.
This commit is contained in:
Dave Methvin 2013-11-14 16:10:43 -05:00
parent 473c7db79e
commit 9ca87af44c

View File

@ -6,13 +6,9 @@ define([
// 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)
jQuery.ajaxSettings.xhr = window.ActiveXObject ? jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
/* Microsoft failed to properly // Support: IE6+
* implement the XMLHttpRequest in IE7 (can't request local files), // XHR cannot access local files, always use ActiveX for that case
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() { function() {
return !this.isLocal && createStandardXHR() || createActiveXHR(); return !this.isLocal && createStandardXHR() || createActiveXHR();
} : } :