我已经使用类似的代码设置了以前工作的数据表,但由于某种原因,我的网站的其他区域拒绝工作,并抛出TypeError:g [(d + i)] [f]未定义
代码:
<table id="tableSearchResults" class="table table-striped table-hover">
<thead>
<tr>
<th>Amenity</th>
<th>Activity</th>
<th>Period</th>
<th>Booked by</th>
<th>Unit</th>
<th>Reference</th>
<th>Status</th>
<th class="no-sort"></th>
<tr>
</thead><tbody></tbody></table>
var dataSet = [["Ballroom", "lalalala", "2/6/2017<br />10:00 AM - 12:30 PM", "Internal booking", "N/A", "", "<a href='#' id='payment43' data-toggle='popover' data-html='true' data-content='<b>Received By</b><br />Robert Benedetto<br />2/6/2017 2:59:24 PM'>PAID</a>", "<a href='amenity_booking.aspx?d=43&bb=0' onclick='return confirm("Are you sure you want to permanently delete this booking?");'><i class='fa fa-trash'></i></a>"], ["Ballroom", "Testing", "8/29/2017<br />9:00 AM - 9:30 AM", "HoangTest TranTest", "<a href='unit_info.aspx?uid=7005'>1S Narra, 1408</a>", "", "<span class='label label-danger'>PENDING</span>", "<a href='amenity_booking.aspx?d=44&bb=1' onclick='return confirm("Are you sure you want to permanently delete this booking?");'><i class='fa fa-trash'></i></a>"]];
$("#tableSearchResults").DataTable({
data: dataSet,
"deferRender": true,
"lengthMenu": [[50, 100, 150, 200, 250, -1], [50, 100, 150, 200, 250, "All"]],
"iDisplayLength": 100,
"order": [],
"columnDefs": [{ "targets": 'no-sort', "orderable": false }, { "searchable": false, "targets": [2, 6, 7] }]
});
有人可以发现任何关闭的东西吗?我当然可以。
答案 0 :(得分:0)
您没有关闭tr
元素,它应该是</tr>
而不是<tr>
。