我正试图通过此链接使用jQuery的Datatable JS来处理我的项目.
我从同一个源下载了完整的库.包中给出的所有示例似乎都运行正常,但是当我尝试将它们合并到我WebForms的CSS中时,JS根本不起作用.
这是我做的:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<table id="myTable" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<!-- table body -->
</tbody>
</table>
</div>
<script src="js/jquery.dataTables.js" type="text/javascript"></script>
<script src="js/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#myTable').DataTable();
});
</script>
</form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的解决方案中JS和CSS的文件结构如下所示:

我已经添加了所有必要的JS和CSS引用,如手册中所示.渲染仍然不如预期.没有CSS,甚至JS都不起作用.
同样在控制台中我收到以下错误: …