Permalink
Browse files

Use XHR on IE 10 rather than XDR

  • Loading branch information...
1 parent 396748b commit 501d35abb7195f200e70ad24bfb4a18ce462b12e @jfirebaugh jfirebaugh committed Jun 10, 2014
Showing with 3 additions and 10 deletions.
  1. +3 −10 corslite.js
View
@@ -11,19 +11,14 @@ function corslite(url, callback, cors) {
(location.port ? ':' + location.port : ''));
}
- var x;
+ var x = new window.XMLHttpRequest();
function isSuccessful(status) {
return status >= 200 && status < 300 || status === 304;
}
- if (cors && (
- // IE7-9 Quirks & Compatibility
- typeof window.XDomainRequest === 'object' ||
- // IE9 Standards mode
- typeof window.XDomainRequest === 'function'
- )) {
- // IE8-10
+ if (cors && !('withCredentials' in x)) {
+ // IE8-9
x = new window.XDomainRequest();
// Ensure callback is never called synchronously, i.e., before
@@ -40,8 +35,6 @@ function corslite(url, callback, cors) {
}, 0);
}
}
- } else {
- x = new window.XMLHttpRequest();
}
function loaded() {

0 comments on commit 501d35a

Please sign in to comment.