Invalid JSON Error but actually valid?
Invalid JSON Error but actually valid?
This is the JS:
$(".tabel-penghuni table").DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "data.php",
"data": {
"key": "tOmQ2OaWiX4DcnXZfK29HyK9QekITCYMfqBpU2Uv"
}
}
});
This is the Servers-side returning data, im using Postman:
{"draw":0,"recordsTotal":5,"recordsFiltered":5,"data":[{"1":"fariz"},{"1":"adnin"},{"1":"haves"},{"1":"alfis"},{"1":"fariz"}]}
i dont know how to fix, im using debugger, no error shown, kinda frustated for now... can you help me?
Answers
This is not correct. The
draw
parameter is a sequence number and should reflect the sequence sent from the client. See the Server side processing docs for more details.Maybe this is why you are seeing
"draw":0
. What is the JSON response you see using the browser's network inspector tool? See the steps outlined in the technote linked in the error:https://datatables.net/manual/tech-notes/1
Kevin
hi kthorngren, thank you for the response, and sorry for late reply.
its solved but i dont know what ive done, i just trying to type the code from beginning. thanks