Unable to bind ajax JSON object to Data table.
Unable to bind ajax JSON object to Data table.

I read the documentation but was not able to figure out what exactly I am doing it wrong.
Please find my json object details here
Error Details: -
DataTables warning: table id=example - Requested unknown parameter '0' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4
HTML Code -
<table id="example"><thead>
<tr>
<th>exchange</th>
<th>lastPrice</th>
<th>percentChange</th>
<th>performanceId</th>
<th>priceChange</th>
<th>standardName</th>
<th>ticker</th>
<th>volume</th>
</tr>
</thead></table>
JS Code -
$('#example').DataTable( {
ajax: {
url: '/scanner/getmovers.php',
dataSrc: 'losers',
columns: [
{ data: 'exchange' },
{ data: 'lastPrice' },
{ data: 'percentChange' },
{ data: 'performanceId' },
{ data: 'priceChange' },
{ data: 'standardName' },
{ data: 'ticker' },
{ data: 'volume' } ]},} );
Answers
You need to move your
columns
config outside of theajax
option. Like this:Kevin