Skip to content

Commit

Permalink
Only make XDomainRequest Transport available if cross-domain XHR requ…
Browse files Browse the repository at this point in the history
…ests are not available.
  • Loading branch information
blueimp committed Feb 9, 2012
1 parent 67969d4 commit 01c97b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/cors/jquery.xdr-transport.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery XDomainRequest Transport Plugin 1.1
* jQuery XDomainRequest Transport Plugin 1.1.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
Expand All @@ -13,7 +13,7 @@
*/

/*jslint unparam: true */
/*global define, window, XDomainRequest */
/*global define, window, XDomainRequest, XMLHttpRequest */

(function (factory) {
'use strict';
Expand All @@ -26,7 +26,8 @@
}
}(function ($) {
'use strict';
if (window.XDomainRequest) {
if (window.XDomainRequest && (!window.XMLHttpRequest ||
(new XMLHttpRequest()).withCredentials === undefined)) {
$.ajaxTransport(function (s) {
if (s.crossDomain && s.async) {
if (s.timeout) {
Expand Down

0 comments on commit 01c97b7

Please sign in to comment.