Error when there is no data to display JSON/AJAX
Error when there is no data to display JSON/AJAX
kezman10
Posts: 12Questions: 3Answers: 0
Good morning, I am recently implementing Datatable with ajax and json, and it works correctly for me, but I am finding that when I load the data if the result is zero data, it throws me an error like the following:
**DataTables warning: table id=listadoDocument - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1**
Thanks for all
This question has an accepted answers - jump to answer
Answers
Have you followed the guide at the tech note the error message links to? What is the response from the server? If there is zero data you must send an empty array back - e.g.:
Allan
its works, thanks for all