How to catch ajax connection error and stop Datatables from throwing an alert?
How to catch ajax connection error and stop Datatables from throwing an alert?
edwardc
Posts: 30Questions: 11Answers: 0
I use connection to multiple sites that are source for my data. One's may be offline at some point and I just want to catch the error (ajax could not load) and inform the user and move on.
This should be pretty simpler but I can't figure it out.
- I managed to catch the error using documentation from here: event: error
- I [... do something with the error...]
- but then I get: "DataTables warning: table id= myID - Ajax error. For more information about this error, please see http://datatables.net/tn/7"
How can I ask Datatable to do nothing after processing my error function?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Have your
error
handler returntrue
. That should be all that is needed (although I've got a feeling you are going to tell me not... If so, can you give me a link to the page?).Allan
Woow... you must have some paranormal skills. :-)
I pm you with the link to the page and the JS.
Here is the code to initialize dt:
any news?
Sorry - I hadn't fully understood that the issue was still present with the above code.
Could you give me a link to an error showing the issue so I can trace it through please?
Allan
sent as pm