No valid JSON
No valid JSON
davidhernandez
Posts: 4Questions: 1Answers: 0
I have a datatable declaration:
var table = $('#dtAssistance').DataTable({
"processing": true,
"serverSide": true,
"ajax": $.ajax({
dataSrc: "",
method: "POST",
url: "../testing/LogGetter.php",
dataType: "json",
data: {
target: "SuscriptionAdministrator",
type: "getAssistanceLog"
}
}),
"columns": [
{data: "DateTime"},
{data: "Name"},
],
"order": [0,"des"]
});
And i get an invalid json response message.
When i follow the steps to verify jason response it seems to be a valid response.
Any ideas that whats happend?
This discussion has been closed.
Answers
the picture is the response that i recieve to the request
jquery ajax dont support dataSrc attribute. I resolved the problem like this:
`
Yes. That is the correct way to do it.
The code in your first post was assigning the result of
$.ajax()
to theajax
option in DataTables which won't work.Allan