Ada*_*tus 3 javascript jquery datatables
我的错误是:
"Uncaught TypeError: ba is undefined"
"https://cdn.datatables.net/v/dt/dt-1.10.22/b-1.6.5/b-print-1.6.5/r-2.2.6/datatables.min.js:119"
Run Code Online (Sandbox Code Playgroud)
没有显示其他错误。我将 Jquery 放在列表中的第一位并检查了所有路径是否有效。我还从数据表站点获得了我认为最合适的链接。
<!DOCTYPE html>
<html lang="en">
<head>
<title>Ajax Filter table</title>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.22/b-1.6.5/b-print-1.6.5/r-2.2.6/datatables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.22/b-1.6.5/b-print-1.6.5/r-2.2.6/datatables.min.js"></script>
<script>
$(document).ready(function(){
$('#table').DataTable();
})
</script>
</head>
<body>
<div class="container">
<table class="table table-striped" id="table">
<tr>
<th>one</th>
<th>two</th>
<th>three</th>
<th>four</th>
</tr>
<tr>
<td>one</td>
<td>two</td>
<td>three</td>
<td>four</td>
</tr>
</table>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
解决方案是以数据表喜欢的方式构建表。他们的主页上没有任何关于此的内容,他们告诉您这只是导入 2 个脚本文件的情况。但是它们要求您使用 thead 和 tbody 元素。没有这个,它就会失败,错误对诊断根本没有帮助!
| 归档时间: |
|
| 查看次数: |
1739 次 |
| 最近记录: |