anurodh
anurodh

Reputation: 295

How can we monitor failure in jquery ajax call

Everyone, can anyone tell me how to monitor failure in jquery ajax call. We have 'success:' for success but is there is anyway to detect failure event.

Thanks

Upvotes: 0

Views: 61

Answers (2)

supakeen
supakeen

Reputation: 2924

There is also the 'error' callback.

Upvotes: 0

Sarfraz
Sarfraz

Reputation: 382909

There is error callback for that:

$.ajax({ 
 ........,
 ........,
 success: function(){alert('success !');},
 error:function(){alert('failed!');},
});

See the DOCS for more information :)

Upvotes: 3

Related Questions