DataTables warning: JSON data from server could not be parsed

DataTables warning: JSON data from server could not be parsed

lucaswxplucaswxp Posts: 1Questions: 0Answers: 0
edited March 2014 in General
Hey guys! I hope someone can help me with this...

I have a table that it's loading the data normally, but I still receive this parse error:
DataTables warning (table id = 'datat'): DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.

I have no ideia why, here is my table:

[code]

jQuery(function($){

$('#datat').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "get_json.php",
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0, 5 ] }
],
"oLanguage": {
"sLengthMenu": "_MENU_ emails por página"
}
} ).fnSort( [ [1,'desc'] ] );
})







Índice
Assunto
De
Status







[/code]

And here is the json server received (seems correct to me):

[code]{"sEcho":2,"iTotalRecords":"2","iTotalDisplayRecords":"2","aaData":[["","2","Tenha o Gmail em seu dispositivo m\u00f3vel","Equipe do Gmail ","Criado","<\/i><\/a>"],["","1","Dicas para usar o Gmail","Equipe do Gmail ","Criado","<\/i><\/a>"]]}[/code]

The headers are also with the correct mime type. Any ideias?

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    That is not valid JSON. Presumably your script get_json.php needs fixing.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Yup - the error means exactly what it says!

    See also: http://next.datatables.net/manual/tech-notes/1

    Allan
This discussion has been closed.