How to catch if response status code is 404 in server side data tables?
How to catch if response status code is 404 in server side data tables?

here is what i done so far
$('#field_list').DataTable().destroy();
self.dataTable = $("#field_list").DataTable({
processing: true,
serverSide: true,
searching: false,
"aaSorting": [ [0,"desc" ]],
"scrollX": true,
ajax: {
data: function (data) {
data.token = localStorage.getItem("token"),
},
'url': '/api/v1/site-field-library,
dataFilter: function (data) {
self.closeFullPageLoader();
var json = jQuery.parseJSON(data);
var response = json.data.searchResults;
self.fields = response.site_fields;
json.data = response.site_fields;
json.recordsFiltered = response.recordsFiltered;
json.recordsTotal = response.recordsTotal;
return JSON.stringify(json);
}
},
columns: [.......]
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
This thread should help,
Colin
@colin actually what i want is to know how should i catch response exceptions like 404 when using server side datatables. can you please give me a solution?
thanks
This SO thread discusses what to do in that scenario.
Colin
i got the solution
thank you so much @colin.