Skip to content

Commit 425a753

Browse files
author
Jason Moon
committed
Merge pull request #6 from jcruz2us/master
Requests using Protocol-less URLs fail
2 parents 64bbfb8 + cb585b0 commit 425a753

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jQuery.XDomainRequest.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (!jQuery.support.cors && window.XDomainRequest) {
1111
// ajaxTransport exists in jQuery 1.5+
1212
jQuery.ajaxTransport('text html xml json', function(options, userOptions, jqXHR){
1313
// XDomainRequests must be: asynchronous, GET or POST methods, HTTP or HTTPS protocol, and same scheme as calling page
14-
if (options.crossDomain && options.async && getOrPostRegEx.test(options.type) && httpRegEx.test(userOptions.url) && sameSchemeRegEx.test(userOptions.url)) {
14+
if (options.crossDomain && options.async && getOrPostRegEx.test(options.type) && httpRegEx.test(options.url) && sameSchemeRegEx.test(options.url)) {
1515
var xdr = null;
1616
var userType = (userOptions.dataType||'').toLowerCase();
1717
return {
@@ -67,6 +67,11 @@ if (!jQuery.support.cors && window.XDomainRequest) {
6767
complete(status.code, status.message, responses, allResponseHeaders);
6868
}
6969
};
70+
71+
//set an empty handler for 'onprogress' so requests don't get aborted
72+
xdr.onprogress = function () {
73+
};
74+
7075
xdr.onerror = function(){
7176
complete(500, 'error', {
7277
text: xdr.responseText

0 commit comments

Comments
 (0)