这是我的代码:
$(document).ready(function () {
var table = $('#employeeDetails').DataTable( {
"lengthMenu": [[5,10 , 15, -1], [5, 10, 15, "All"]],
"ajax": "employeeDetails.json",
"aoColumns": [{
"mData": "name"
},{
"mData": "age"
},{
"mData":"designation"
},{
"mData": "salary"
}]
});
});
和HTML
<table id="employeeDetails">
</table>
如何从单独的JSON文件中获取列标题?