Skip to content

Commit

Permalink
Ajax: Use the native XHR for all non-local requests in IE9+
Browse files Browse the repository at this point in the history
IE throws an error on cross-domain PATCH requests if issued via the ActiveX
interface. This commit switches the logic to use the native XHR in all
non-local requests.

Fixes jquerygh-1684
Closes jquerygh-2183
  • Loading branch information
mgol committed Apr 7, 2015
1 parent 8992ac8 commit a1965f2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ajax/xhr.js
Expand Up @@ -19,7 +19,19 @@ jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
// and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
// Although this check for six methods instead of eight
// since IE also does not support "trace" and "connect"
/^(get|post|head|put|delete|options)$/i.test( this.type ) &&
//
// Support: IE 10-11
// IE seems to error on cross-domain PATCH requests when ActiveX XHR
// is used. Use the following strategy:
// 1. If request is local, use the ActiveX XHR.
// 2. Otherwise, in IE9+ always use the native XHR.
// 3. Otherwise, in IE8 if request type is *not* included in the following
// list, use the ActiveX XHR.
// 4. Otherwise, use the native XHR.
// jshint -W018
( !( document.documentMode < 9 ) ||
// jshint +W018
/^(get|post|head|put|delete|options)$/i.test( this.type ) ) &&

createStandardXHR() || createActiveXHR();
} :
Expand Down

0 comments on commit a1965f2

Please sign in to comment.