Invalid Json Response
Invalid Json Response
Hello,,
while im using mongodb with sails.js, iam fetching large amount of data from my db and using server side processing.I'm getting this error...
DataTables warning: table id=contacts_table - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
and my code
var table = $('#contacts_table').dataTable({
"processing": true,
"serverSide": true,
"ajax": "/showlists"
});
code in show lists is given below...(showlists.js)
Contacts.find()
.skip(pageNumber > 0 ? ((pageNumber-1)*10) : 0)
.limit(10)
.exec(function(err,filedata){
return res.json(filedata);
});
can any one help me to fix this problem.......
This question has an accepted answers - jump to answer
Answers
Did you read the information?
yes i read it but am not get understud what to do because the total code is given in php and i'm trying to change it into sails.js code.i dnt want to use any txt r json files is there any way without using this and acess server side processing?
There is no PHP on that page. You should follow the diagnostic advice to find out what is being returned by the server.
yup,, sorry i replyed wrong thing... i tried the Diagnosis process in server data in the firefox but while i clicked on xhr button i wont see any ajax requests....
You'll need to link us to the page for us to be able to debug it in that case.
Allan