Is there some way I can show custom exception messages as an alert in my jQuery AJAX error message?
For example, if I want to throw an exception on the server side v
If someone is here as in 2016 for the answer, use .fail() for error handling as .error() is deprecated as of jQuery 3.0
.fail()
.error()
$.ajax( "example.php" ) .done(function() { alert( "success" ); }) .fail(function(jqXHR, textStatus, errorThrown) { //handle error here })
I hope it helps