You will need to either use the lower level $.ajax call, or the ajaxError function. Here it is with the $.ajax method:
function update() {
$.ajax({
type: 'GET',
dataType: 'json',
url: url,
timeout: 5000,
success: function(data, textStatus ){
alert('request successful');
},
fail: function(xhr, textStatus, errorThrown){
alert('request failed');
}
});
}
EDIT I added a timeout
to the $.ajax
call and set it to five seconds.