php and MsSql with a invaild JSON response

php and MsSql with a invaild JSON response

vino6vino6 Posts: 2Questions: 1Answers: 0
edited August 2016 in Free community support

Hello,
I use the demo http://stackoverflow.com/questions/27558743/how-to-fetch-data-from-mssql-query-for-datatables-using-ajax
but it always return "table id=example - Invalid JSON response" and cannot load data.
then I use JSONLint to validate the data. It is vaild.
I'm confused.
Here's the debug result: http://debug.datatables.net/abimuc

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,813Questions: 1Answers: 10,517 Site admin
    Answer ✓

    If you load the debug trace you gave above and:

    1. Click on the Tables tab at the top
    2. Click the Server interaction header

    You will be able to see what is being returned by the server. It is not valid JSON - it contains HTML as well. You would need to strip all of the HTML out and return only the JSON data for it to be valid JSON.

    Allan

  • vino6vino6 Posts: 2Questions: 1Answers: 0

    Thanks for your help !

This discussion has been closed.