开发者

How can we monitor failure in jquery ajax call

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜