Perform cross domain query, how to perform a certain function if the URL on which it is running is not available (404)?
I try something like this:
$.getJSON({
url:'example.php?callback=?',
statusCode: {
404:function(){alert('404');}
},
success :function(data){//do stuff}
});
Matt posted a great answer in this question that may solve your issue.
You will have to add a
successproperty on your JSON objectKeYan makes a good suggestion by checking the XHR status property if you aren’t expecting timeout issues.
I would vote his solution up, but I lack the rep points.