Possible Duplicate:
jquery (ajax) redirect to another domain
I have the jQuery Ajax request in the following format:
$.ajax({
url: 'xyz.com',
cache: false,
success: function(data){}
);
If the request fails(server not responds), how do i redirect to another domain.
I did the same thing by using jquery getJson in the follwing way:
$.getJSON('xyz.com',function(result) {})
.error(
function(xhr, textStatus, errorThrown){
if (xhr.status == 500) {
$.getJSON('zxy.com', function(result){});
}
});
});