你好,我在服务器端有数据,但响应数据没有显示在ajax中
这是我的代码
<table id="example" class="display table table-striped custom-table datatable">
<thead>
<tr>
<th>Username</th>
<th>Email</th>
<th>Level</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<script>
var dTable;
$(document).ready(function() {
dTable = $('#example').DataTable( {
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": false,
"responsive": false,
"autoWidth": false,
"sAjaxSource": "list_rest", //file php
"sServerMethod": "POST",
"scrollX": true,
"scrollY": "350px",
"scrollCollapse": true,
"columnDefs": [
{ "orderable": false, "targets": 0, "searchable": false},
{ "orderable": true, "targets": 1, "searchable": true},
{ "orderable": true, "targets": 2, "searchable": true}
]
} );
});
</script>
返回 list_rest
{"sEcho":"0","iTotalRecords":1,"iTotalDisplayRecords":1,"aaData":[["admin","admin@admin.com","moderator"]]}
帮帮我,如何解决? 谢谢