Invalid Json Response

Invalid Json Response

gayatrigayatri Posts: 8Questions: 5Answers: 0

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

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    For more information about this error, please see http://datatables.net/tn/1

    Did you read the information?

  • gayatrigayatri Posts: 8Questions: 5Answers: 0

    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?

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    i read it but am not get understud what to do because the total code is given in php

    There is no PHP on that page. You should follow the diagnostic advice to find out what is being returned by the server.

  • gayatrigayatri Posts: 8Questions: 5Answers: 0

    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....

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    You'll need to link us to the page for us to be able to debug it in that case.

    Allan

This discussion has been closed.