我试图使用datatables插件,但是在调用函数dataTable()时出现了错误。 我的代码如下:
@Scripts.Render("~/Scripts/DataTables-1.9.4/media/js/jquery.js")
@Scripts.Render("~/Scripts/DataTables-1.9.4/media/js/jquery.dataTables.js")
<script type="text/javascript">
$(function () {
$('#tableID').dataTable();
});
</script>
<table class="table table-striped table-hover table-bordered" id="tableID">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1</td>
<td>Row 1</td>
</tr>
<tr>
<td>Row 2</td>
<td>Row 2</td>
</tr>
</tbody>
</table>
当我运行它时,我可以在Firebug中看到一个错误:
TypeError: $(...).dataTable is not a function
$('#tableID').dataTable();
在Firebug中,我可以看到已经包含了jquery.dataTables.js文件,但是dataTable()函数无法正常工作。
dataTable()
的函数吗? - domdomcodecode