简体   繁体   English

DataTables警告:表格ID = {id}-无效的JSON响应

[英]DataTables warning: table id={id} - Invalid JSON response

I know above error is explain here " LINK " 我知道上面的错误是在这里解释“ 链接

All is working fine in my local-host thats no error popup , nothing in my local-host. 在我的local-host一切正常,没有错误弹出窗口,在我的本地主机上什么也没有。

But on my online server i am getting above link error : i am not getting what and where is wrong as when i refresh my page after error then i get data properly . 但是在我的在线服务器上,我遇到了链接错误:我没有得到什么,哪里是错误的,因为当我在错误之后刷新页面时,我可以正确地获取数据。

It works for some time and then again start giving me error and again after refresh of page , error is not seen and my table list all data properly . 它工作了一段时间,然后再次开始给我错误,并在刷新页面后再次出现错误,没有看到错误并且我的表正确列出了所有数据。

I check my all MySQL query on my server its working properly and fine. 我在服务器上检查我所有的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 } );
        }
    });

ONLINE SERVER : IF I REFRESH MY PAGE then some time it get my data properly but some time its show me error , but after refresh of page it show me data properly without any error .. not getting what wrong. 在线服务器:如果我刷新我的页面,那么一段时间它会正确地获取我的数据,但有时它会向我显示错误,但是刷新页面后它将正确地向我显示数据,而没有任何错误..不会出错。

same thing is happening for search and pagination and records list . 搜索,分页和记录列表也发生了同样的事情。

Since you are getting output on random refresh it has to do with the data table initialization and assignment of data. 由于您是通过随机刷新获得输出的,因此它与数据表的初始化和数据分配有关。 There are multiple scenarios that can lead to above error; 有多种情况可能导致上述错误。

  • If data is being assigned to grid prior to element is registered in DOM 如果在元素注册到DOM之前将数据分配给网格
  • Data table is being initialized multiple times when its already available in the DOM 数据表在DOM中已经可用时将被多次初始化
    • Solution; 解; Clear the table and reassign the data. 清除表并重新分配数据。
  • Data mist match (in short grid contains columns; Col1, Col2, Col3 while table array is not of same length) 数据薄雾匹配(简短的网格包含列; Col1,Col2,Col3,而表数组的长度不同)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 数据表警告表 id=datatables-example - 无效的 json 响应 - Datatables warning table id=datatables-example - invalid json response DataTables警告:表格ID = staff_data-无效的JSON响应 - DataTables warning: table id=staff_data - Invalid JSON response DataTables警告:table id = example - 无效的JSON响应 - DataTables warning: table id=example - Invalid JSON response php DataTables中的Ajax警告:表格ID = example-无效的JSON响应 - Ajax from php DataTables warning:table id=example - Invalid JSON response DataTables 警告:表 id=tbl - 无效的 JSON 响应。 关于这个错误,请参阅 http://datatables.net/tn/1 - DataTables warning: table id=tbl - Invalid JSON response. about this error, please see http://datatables.net/tn/1 DataTables 警告:表 - 无效的 JSON 响应 - DataTables warning: table - Invalid JSON response 数据表警告:表 id=table_companies - JSON 响应无效。 有关此错误的更多信息,请参阅 http://datatables.net/tn/1 - DataTables warning: table id=table_companies - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1 数据表警告:表 id=users_list - JSON 响应无效。 有关此错误的更多信息,请参阅 http://datatables.net/tn/1 - DataTables warning: table id=users_list - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1 jQuery datatables mysql php DataTables警告(表id ='displayData'):DataTables警告:无法解析JSON数据 - jquery datatables mysql php DataTables warning (table id='displayData'): DataTables warning: JSON data from could not be parsed Datatables.net | 表 id=tbl_portfolio - 无效的 JSON 响应 - Datatables.net | table id=tbl_portfolio - Invalid JSON response
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM