Adding error-handler to ajax produces additional request
Adding error-handler to ajax produces additional request
Vyacheslav
Posts: 70Questions: 27Answers: 0
I see something strange in console (http://localhost:3001/errajax)
I just added a stub to ajax object and datatables began to produce an additional json-request like:
GET https://datatbl.herokuapp.com/errajax?_=1448540064717
var table = $('#users').DataTable( {
ajax: { error: function( e, settings, techNote, message ) {} }
});
Is it a bug or one more time my mistake?
This discussion has been closed.
Answers
See http://plnkr.co/edit/SQ5JE9?p=preview
I am increasingly convinced that if the datatable settings have even empty
DataTable will try to get data via ajax despite the fact that a url is absent (empty).
I believe this is not convenient because it eliminates the possibility to set up a common error handler in defaults i.e.
To avoid the current behavior I have to write
for every datatable with static data source.