Issue
I need help handling 403 errors that come from my server in $.ajax request of jquery. It sends it as JS error because the request is forbidden but I just want the error to be a part of Ajax response, not just a JS error that fails the entire application. The 403 comes from OAuth2. If any code needs to be provided to clarify my question better, please let me know.
How can I achieve that?
Solution
Solution: The best I found to deal with this situation per ajax request is to use statusCode method:
statusCode: {
403: function() {
},
200: function(data) {
}
//other codes. read the docs for more details
}
Answered By - Gasim Answer Checked By - Gilberto Lyons (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.