相关疑难解决方法(0)

TypeError:$(...).DataTable不是函数

我正试图通过链接使用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的文件结构

我已经添加了所有必要的JS和CSS引用,如手册中所示.渲染仍然不如预期.没有CSS,甚至JS都不起作用.

同样在控制台中我收到以下错误: …

javascript css asp.net jquery datatables

62
推荐指数
8
解决办法
25万
查看次数

有没有办法在 JQuery Datatable 的标题文本旁边显示排序图标?

喜欢这张图

有什么方法可以像上图一样在标题文本旁边显示数据表的排序图标?

sorting jquery datatables

3
推荐指数
1
解决办法
2990
查看次数

标签 统计

datatables ×2

jquery ×2

asp.net ×1

css ×1

javascript ×1

sorting ×1