Skip to content

Commit

Permalink
A quick change to detect AIR urls
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarf committed Feb 24, 2011
1 parent 58faec7 commit 14e9da5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var r20 = /%20/g,
rucHeadersFunc = function( _, $1, $2 ) {
return $1 + $2.toUpperCase();
},
rurl = /^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?|\/[^\/])/,

// Keep a copy of the old load method
_load = jQuery.fn.load,
Expand Down
12 changes: 12 additions & 0 deletions test/unit/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -2239,6 +2239,18 @@ test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});

test("jQuery.ajax - compatible with AIR urls"), function() {
expect( 1 );
stop();
$.ajax({
url: "app:/testing",
beforeSend: function() {
ok( this.crossDomain, "Detected crossDomain for AIR Url" );
return false;
}
});
});

}

//}

2 comments on commit 14e9da5

@gnarf
Copy link
Member Author

@gnarf gnarf commented on 14e9da5 Feb 24, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test in this commit is completely wrong, and was fixed in +1 (sorry)

@mathiasbynens
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here’s a link to the commit with the fixed test: 71bd828

Please sign in to comment.