Permalink
Browse files

A quick change to detect AIR urls

  • Loading branch information...
1 parent 58faec7 commit 14e9da51f96a7a9b1a5c239c32f4abe20eb2b795 @gnarf gnarf committed Feb 24, 2011
Showing with 13 additions and 1 deletion.
  1. +1 −1 src/ajax.js
  2. +12 −0 test/unit/ajax.js
View
@@ -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,
View
@@ -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;
+ }
+ });
+});
+
}
//}

0 comments on commit 14e9da5

Please sign in to comment.