我正在执行 ajax 调用,但数据表在响应后没有更新。我已经尝试了几个功能。请注意,我使用 jQuery 版本 2.2.4
$.ajax({
type: 'POST',
url: URL,
data: parsed,
dataType: "json",
beforeSend: function() {}
}).done(function(data) {
let Content = '';
$("#order-table-data").html(Content);
$("#datatable").trigger("update");
$("#datatable").ajax.reload(); //Cannot read property 'reload' of undefined
})
html:
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>Product</th>
<th>Stock</th>
<th>Price</th>
<th>Quantity</th>
<th>Order</th>
</tr>
</thead>
<tbody id="order-table-data"></tbody>
</table>