git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
58faec7
)
A quick change to detect AIR urls
author
gnarf
<gnarf@gnarf.net>
Thu, 24 Feb 2011 19:10:33 +0000
(13:10 -0600)
committer
gnarf
<gnarf@gnarf.net>
Thu, 24 Feb 2011 19:10:33 +0000
(13:10 -0600)
src/ajax.js
patch
|
blob
|
history
test/unit/ajax.js
patch
|
blob
|
history
diff --git
a/src/ajax.js
b/src/ajax.js
index
6414e8c
..
4714afd
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-19,7
+19,7
@@
var r20 = /%20/g,
rucHeadersFunc = function( _, $1, $2 ) {
return $1 + $2.toUpperCase();
},
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,
// Keep a copy of the old load method
_load = jQuery.fn.load,
diff --git
a/test/unit/ajax.js
b/test/unit/ajax.js
index
335c2ac
..
4ce15f8
100644
(file)
--- a/
test/unit/ajax.js
+++ b/
test/unit/ajax.js
@@
-2239,6
+2239,18
@@
test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});
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;
+ }
+ });
+});
+
}
//}
\ No newline at end of file
}
//}
\ No newline at end of file