[英]Datatables warning table id=datatables-example - invalid json response
[英]DataTables warning: table id={id} - Invalid JSON response
我知道上面的錯誤是在這里解釋“ 鏈接 ”
在我的local-host
一切正常,沒有錯誤彈出窗口,在我的本地主機上什么也沒有。
但是在我的在線服務器上,我遇到了鏈接錯誤:我沒有得到什么,哪里是錯誤的,因為當我在錯誤之后刷新頁面時,我可以正確地獲取數據。
它工作了一段時間,然后再次開始給我錯誤,並在刷新頁面后再次出現錯誤,沒有看到錯誤並且我的表正確列出了所有數據。
我在服務器上檢查我所有的MySQL查詢,它均正常運行。
var oTableL1 = $('#table1').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "includes/db/list_db.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "more_data", "value": "tablequeryone" } );
// aoData : passing parameter in my list_db.php where
i have used if else-if code for resp. which is working fine
in my local-host, also on server after refresh
}
});
var oTableL2 = $('#table2').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "includes/db/list_db.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "more_data", "value": "tablequerytwo" } );
}
});
var oTableL3 = $('#table3').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "includes/db/list_db.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "more_data", "value": "tablequerythree } );
}
});
在線服務器:如果我刷新我的頁面,那么一段時間它會正確地獲取我的數據,但有時它會向我顯示錯誤,但是刷新頁面后它將正確地向我顯示數據,而沒有任何錯誤..不會出錯。
搜索,分頁和記錄列表也發生了同樣的事情。
由於您是通過隨機刷新獲得輸出的,因此它與數據表的初始化和數據分配有關。 有多種情況可能導致上述錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.