how to get response json data
how to get response json data
vtxmg
Posts: 1Questions: 1Answers: 0
I have included additional data in server-side but I couldn't find a way to get json response data in every ajax request.
This discussion has been closed.
Answers
so, if I understand you right, you are sending back extra data with each response. There are several ways to do this, the way I do it is usually with the dataFilter callback that looks something like
$("#example").DataTable({
...
ajax: {
url:"pathtoserver",
data:data,
dataFilter: function(resp) {
// deserialize resp if needed.
// peel off the exta data and pass it on
// make sure the data for the table is the way datatable expects it
return that data object for datatables use
}
},
,,,
});