DataTables warning: JSON data from server

DataTables warning: JSON data from server

desidocdesidoc Posts: 13Questions: 0Answers: 0
edited October 2013 in DataTables 1.9
HI

My problem is that on localhost i have no error, but once i put the php pages on my web server fails with this error

DataTables warning (table id = 'dataTable'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.

Has anyone any idea on what's happening

Thanks

Replies

  • desidocdesidoc Posts: 13Questions: 0Answers: 0
    ups i forgot to mention i'm using MySql
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    The error means exactly what it says - the server is returning invalid JSON!

    Please link to a debug trace or test case as noted in the forum rules if we are to be able to offer any help - although it would likely just be pointing out what the invalid JSON data is. Look at the XHR return in your browser to see what it is.

    Allan
  • desidocdesidoc Posts: 13Questions: 0Answers: 0
    hello allan,

    thanks for your comment, i have to tell you that after seeing how to use firebug i solved my problem, it was a variable not declared :S

    Thanks so much
  • pingopingo Posts: 3Questions: 0Answers: 0
    Is there anyway to suppress such warnings rather than fixing them?
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Why would you want to ignore JSON formatting errors? Bad JSON means no table data.
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Its not really a warning - its an error. An error on the part of the data sent back by the server. It should be sending JSON. If you see this message - then it is not. Thus an error and not something you want to ignore!

    Allan
This discussion has been closed.