Catch AJAX statusCode
Catch AJAX statusCode
I would like to catch the statusCode 403. Because the API I use returns this whenever there is no active session. Sadly I can't show a working example because the API is ran locally here.
Now I tried searching on this site and found references to using the ajax
property with a function. However I have difficulty translating this example (which uses local storage) to AJAX.
Because I can't post a working example I posted the datatables call:
http://pastebin.com/GWWkCn7L
I also have a picture of the console.log, javascript error and the api return (in browser):
http://i65.tinypic.com/20z5tlf.png
I hope this does provide enough information.
Edit: Forgot to mention, the catching of the 403 statusCode actually works; but it doesn't display the data anymore.