JSON formatting error
JSON formatting error
Hi!
I am getting this error:
DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.
I have:
{
"iTotalDisplayRecords":10,
"iTotalRecords":3,
"aaData":[{"1","null","0","192.168.1.182","stop"},{"2","null","0","192.168.1.182","stop"},{"3","null","0","192.168.1.182","stop"}]
}
For my table, I have 5 columns. Please help. Thanks a lot.
I am getting this error:
DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.
I have:
{
"iTotalDisplayRecords":10,
"iTotalRecords":3,
"aaData":[{"1","null","0","192.168.1.182","stop"},{"2","null","0","192.168.1.182","stop"},{"3","null","0","192.168.1.182","stop"}]
}
For my table, I have 5 columns. Please help. Thanks a lot.
This discussion has been closed.
Replies
Allan
The advice stands even if you're not using PHP; I just mention it because I had the error periodically when polling SQL through PHP; since switching to a Java Server application, we are not seeing the same JSON parse errors anymore.
It'll just tell you what you already know: that the JSON is invalid; but seeing it on the server instead of on the client side is often the concrete validation that puts you into "debug the server side" mode instead of "debug DataTables configuration" mode.
Greg
I have
[code]
{
"sEcho": 1,
"iTotalDisplayRecords": 1,
"iTotalRecords": 1,
"aaData": [
[
"1",
"null",
"0",
"192.168.1.182",
"stop"
]
]
}
[/code]
but I am getting the formatting error. It has passed JSONLint.
Allan