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