当前位置: 代码迷 >> 综合 >> 报错:datatables warning :cannot reinitialise datatable. to retrieve the datatables object for this
  详细解决方案

报错:datatables warning :cannot reinitialise datatable. to retrieve the datatables object for this

热度:98   发布时间:2023-10-12 19:15:37.0

报错:datatables warning :cannot reinitialise datatable.

  • datatables warning :cannot re initialise datatable.
  • 错误一: src路径错误,js 前需要加 /
  • 错误二:script被包含在head里面

datatables warning :cannot re initialise datatable.

to retrieve the datatables object for this table,pass no arguments or see the docs for bretrieve and bdestory
报错:datatables warning :cannot reinitialise datatable. to retrieve the datatables object for this
数据表警告:无法重新初始化数据表。
若要检索此表的datatables对象,请不传递参数或查看bretrieve和bdestory的文档

错误一: src路径错误,js 前需要加 /

同文件夹下

<script src="js/jquery.flot.js"></script>
<script src="js/jquery.flot.pie.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.min.js"></script>

代码变成这样
不同文件夹下 ./

<script src="./js/jquery.flot.js"></script>
<script src="./js/jquery.flot.pie.js"></script>
<script src="./js/jquery.flot.stack.js"></script>
<script src="./js/jquery.flot.resize.min.js"></script>

错误二:script被包含在head里面

报错:datatables warning :cannot reinitialise datatable. to retrieve the datatables object for this
修改为
将script代码放到 body 里面报错:datatables warning :cannot reinitialise datatable. to retrieve the datatables object for this

  相关解决方案