I have a global $(document).ajaxError
that takes care of most errors for me if an unexpected 500 error occurs or something else. However, there are times when I want to catch errors locally in a script and then prohibit calling the global error handler. Is there a way to do this, for example with event.stopPropagation ()?
Example
$.get('/something/', function() { alert("Stuff went well."); }).error(function(response)) { if (response.status == 404) { alert('Page not found');
source share