// 点击查询按钮
$("#carBtn").on('click', function () {
$.ajax({
url: '',
type: 'POST',
// 开始时间和结束时间传给你
data: {minDate: $(".startCreateTime").val(), maxDate: $(".endCreateTime").val()},
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
alert('获取到数据之后的操作');
}
});
})
});
It shouldn’t be written like this. Datatables has its own method to refresh. Generally speaking, there is no need to write ajax manually
When the data changes (when the button is clicked), you should set the value into
data
方法里,然后调用$('#_list').DataTable().ajax.reload()
It will be refreshed