Skip to content

Commit c0b3520

Browse files
author
Jason Moon
committed
Add check for $.ajaxTransport so this won't bomb in jQuery < 1.5
1 parent 425a753 commit c0b3520

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

jQuery.XDomainRequest.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// jQuery.XDomainRequest.js
22
// Author: Jason Moon - @JSONMOON
33
// IE8+
4-
if (!jQuery.support.cors && window.XDomainRequest) {
4+
if (!jQuery.support.cors && jQuery.ajaxTransport && window.XDomainRequest) {
55
var httpRegEx = /^https?:\/\//i;
66
var getOrPostRegEx = /^get|post$/i;
77
var sameSchemeRegEx = new RegExp('^'+location.protocol, 'i');
@@ -67,11 +67,8 @@ if (!jQuery.support.cors && window.XDomainRequest) {
6767
complete(status.code, status.message, responses, allResponseHeaders);
6868
}
6969
};
70-
7170
//set an empty handler for 'onprogress' so requests don't get aborted
72-
xdr.onprogress = function () {
73-
};
74-
71+
xdr.onprogress = function(){};
7572
xdr.onerror = function(){
7673
complete(500, 'error', {
7774
text: xdr.responseText

0 commit comments

Comments
 (0)