mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Ajax: Fix #14424. Use ActiveX in IE9+ on local files, close gh-1434.
We can't feature detect ActiveX in IE11, but we can just call it and catch whatever error occurs, then try normal XHR.
This commit is contained in:
parent
d0782ed7e8
commit
498e0e6c9b
@ -20,6 +20,7 @@
|
||||
"globals": {
|
||||
"jQuery": true,
|
||||
"define": true,
|
||||
"module": true
|
||||
"module": true,
|
||||
"ActiveXObject": true
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,14 @@ define([
|
||||
], function( jQuery, support ) {
|
||||
|
||||
jQuery.ajaxSettings.xhr = function() {
|
||||
// Support: IE9+
|
||||
// IE can't get local files with standard XHR, only ActiveX
|
||||
if ( this.isLocal ) {
|
||||
try {
|
||||
return new ActiveXObject( "Microsoft.XMLHTTP" );
|
||||
} catch( e ) {}
|
||||
}
|
||||
|
||||
try {
|
||||
return new XMLHttpRequest();
|
||||
} catch( e ) {}
|
||||
|
Loading…
Reference in New Issue
Block a user