在这里我是新手ajax DataTables
。我正在尝试connect
我的database
和. 但我得到了这个错误:fetch records
dataTable
datatables warning table id=datatables-example - invalid json response有关此错误的更多信息,请参阅 http://datatables.net/tn/1
我遵循了名为 的教程web lesson
,以防我试图在互联网上找到解决方案但没有帮助我解决我的问题。这是我的HTML
片段:
<table id="datatables-example" class="table table-striped table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>Appointment ID</th>
<th>Doctor Name</th>
<th>Specialization</th>
<th>Patient Name</th>
<th>Fees</th>
<th>Appointment Date</th>
<th>Appointment Time</th>
<th>Status</th>
<th class="text-right">Action</th>
</tr>
</thead>
</table>
以下是Ajax片段:
<script>
$(document).ready(function() {
load_data();
function load_data(){
var datatable= $('#datatables-example').DataTable({
"processing": true,
"serverSide": true,
"order" :[],
"ajax" : {
url: "sidebar/apt_table admin.php", // Url to which the request is send
method: "POST", // Type of request to be send, called as method
}
});
}
});
</script>
开满天机
慕尼黑的夜晚无繁华