Coerce s.url to string before calling replace, since replace is also a method of a Location object. Fixes #7531.

This commit is contained in:
Colin Snover 2010-11-17 00:59:24 -06:00
parent 0838bdf52c
commit 2a0c7d702b
2 changed files with 14 additions and 1 deletions

View file

@ -1350,6 +1350,16 @@ test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});
test( "jQuery.ajax - Location object as url (#7531)", 1, function () {
var success = false;
try {
var xhr = jQuery.ajax({ url: document.location });
success = true;
xhr.abort();
} catch (e) {}
ok( success, "document.location did not generate exception" );
});
}