How to suppress or hide ajax error?

How to suppress or hide ajax error?

don2don2 Posts: 27Questions: 15Answers: 0

How to suppress ajax error?

I have figured out the ajax error, because of the session has timed out, but how to suppress or hide it, I expect to only refresh the page if the ajax error occurs.. I have tried the following:

     ![](https://datatables.net/forums/uploads/editor/io/k3h9stwn45hf.png "")

.on( 'error.dt', function ( e, settings, techNote, message ) {
e.preventDefault();
location.reload();
return true;
});

I need advice, many thanks in advance

Don

Answers

  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin

    Have the server return {"data":[],"error":"..."} or something like that when this happens, and then your error handler can check the response and reload the page as required.

    Allan

Sign In or Register to comment.