Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81666

DataTables warning: JSON data from server could not be parsed.

$
0
0
For some reason, this just started happening. I am getting this error when trying to load in my JSON data with AJAX:
"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error."

Firebug is giving this error:
Invalid label
{"aaData:" [

Here is the HTML, JS and JSON. I have no idea what happened or why...does anyone here?

Table HTML:
 
   <table id="test_table">
        <thead>
            <tr>
                <th>One</th>
                <th>Two</th>
                <th>Three</th>
                <th>Four</th>
                <th>Five</th>
                <th>Six</th>
                <th>Seven</th>
            </tr>
        </thead>
        <tbody>

        </tbody>
    </table>
Javascript:
    $('#test_table').dataTable({
        "sAjaxSource" : 'dt_ajax.txt'
    });
    

JSON Data:
{"aaData": [
      [
          "<img src=\"images/details_open.png\">",
          "3S",
          "38",
          "09",
          "300000",
          "500000",
          "Test data"
      ],
      [
          "<img src=\"images/details_open.png\">",
          "5I",
          "34",
          "12",
          "500000",
          "1000000",
          "aaaaa"
      ],
      [
          "<img src=\"images/details_open.png\">",
          "Jumbo",
          "9",
          "8",
          "888888",
          "8888888",
          "testtt"
      ]
]}

Thanks in advance! P.S. The data works fine when input directly. Only "sAjaxSource" is getting this error.

Viewing all articles
Browse latest Browse all 81666

Trending Articles