datatable fix error–Invalid JSON response


error

This error is pretty common.

Meaning:
When loading data by Ajax(ajax|option).DataTables by default, expects the data loaded to be valid JSON.

DataTables warning:table id ={id} – Invalid JSON response
It means exactly what is says. DataTables made an Ajax response to the server for JSON data, but the data that
it received back was not valid JSON.

Diagnosis:
First of all, checking what it exactly reply with.Typically, the reponse will consist of an error message from the program
on the server which is being used to create the JSON, which will be the starting poing for resolving the issue fully.

Using firefox web developer tools to get the received JSON.

For my case, the root case is the php code is missing variable defination.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM