开发者

How can we monitor failure in jquery ajax call

开发者 https://www.devze.com 2023-03-21 08:50 出处:网络
Everyone, can anyone tell me how to monitor failure in jqu开发者_运维问答ery ajax call. We have \'success:\' for success but is there is anyway to detect failure event.

Everyone, can anyone tell me how to monitor failure in jqu开发者_运维问答ery ajax call. We have 'success:' for success but is there is anyway to detect failure event.

Thanks


There is error callback for that:

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

See the DOCS for more information :)


There is also the 'error' callback.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号