嗨我无法在DataTable中显示JSON数据。我有一个网址的数据,并希望显示所有的结果。但是没有返回错误,但是没有将JSON中的数据加载到表中?我将附上我正在使用的javaScript,HTML & JSON,我希望有些传说可以帮助我!DataTables Ajax数据不显示
JQuery的
$('#example').DataTable({
"ajax": ({
"url": fxml_url + 'Enroute' + '/airport' + $('#flight_choice').val(),
}),
"columns": [
{ enroute: ident },
{ enroute: originCity },
{ enroute: destinationCity },
{ enroute: estimatedarrivaltime }
]
});
HTML
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Flight No.</th>
<th>Origin</th>
<th>Destination</th>
<th>Arrival Time</th>
</tr>
</thead>
</table>
JSON结构
声明你的'columns'正确。没有*'enroute' *这样的属性,我想你的意思是'data' ... – davidkonrad
哦谢谢,它仍然不显示数据!日志打印'身份未定义'? – giofus