ajax error callback

ajax error callback

AlekhineGunnAlekhineGunn Posts: 2Questions: 0Answers: 0

The API provides callbacks for successful AJAX calls but what about when something goes wrong? For example, if the user's session has been killed, the REST call might return a 403. How do I deal with that? For example, ajax.reload only provides a success callback as far as I can tell.

Replies

  • kthorngrenkthorngren Posts: 4,805Questions: 19Answers: 1,059

    I think you should be able to use the error function that can be defined in the ajax option. According to the docs:

    As an object, the ajax object is passed to jQuery.ajax allowing fine control of the Ajax request. DataTables has a number of default parameters which you can override using this option.

    However the success parameter should not be overridden.

    Kevin

  • AlekhineGunnAlekhineGunn Posts: 2Questions: 0Answers: 0

    Thank you! All set!

Sign In or Register to comment.