我有一個JSON數據是這樣的如何從JSON響應
var data = '{"aaData":[{"rrno":"RR201600001","name":"Vikram","dob":"2016-04-11","gender":"Male","job_profile":"Buisness Associate","graduation":"B.Tech\/B.E.","total_exp":1,"status":"Accepted"},
{"rrno":"RR201600002","name":"Rahul","dob":"1992-10-13","gender":"Male","job_profile":"Buisness Associate","graduation":"B.Tech\/B.E.","total_exp":3,"status":"Rejected"}]}';
然後我加載這個數據在數據表中這樣
var table = $('#dataTable1').DataTable();
table.ajax.url(url).load();
我加載一個jQuery數據表HTML是這樣的
<table id="dataTable1" class="table table-bordered table-striped-col">
<thead>
<tr>
<th>Sourcing ID</th>
<th>Name</th>
<th>Dob</th>
<th>Gender</th>
<th>Job Profile</th>
<th>Basic/Graduation</th>
<th>Total Experience</th>
<th>Final Status</th>
</tr>
</thead>
</table>
但我收到一個POPUP作爲警報說
DataTables warning: table id=dataTable1 - Requested unknown parameter '0' for row 0
你有一個字符串,而不是一個對象。嘗試刪除開始和結束的'''。 – annoyingmouse