0

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

2 Answers 2

3

There is error callback for that:

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

See the DOCS for more information :)

Sign up to request clarification or add additional context in comments.

Comments

0

There is also the 'error' callback.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.