ajax .fail code example
Example 1: ajax error
$.ajax({
type: "post", url: "/SomeController/SomeAction",
success: function (data, text) {
//...
},
error: function (request, status, error) {
alert(request.responseText);
}
});
Example 2: jquery ajax on fail
fail: function(xhr, textStatus, errorThrown){
alert('request failed');
}