[英]dataTable raise error Uncaught TypeError: undefined is not a function
I have install 3 files: 我已经安装了3个文件:
<link href="~/Scripts/DataTables-1.10.0/media/css/jquery.dataTables.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/DataTables-1.10.0/media/js/jquery.dataTables.js"></script>
after that I try to create table: 之后,我尝试创建表:
$('#manage-news').dataTable({ options });
but it raise error: 但这会引发错误:
Uncaught TypeError: undefined is not a function
I try to debug, I see it go to jquery.dataTables first, run pass this line 14378 我尝试调试,我首先看到它进入jquery.dataTables,运行通过此行14378
return $.fn.dataTable;
then it goes to my code, selector $('#manage-news')
has value 然后转到我的代码,选择器
$('#manage-news')
有值
[<table id="manage-news" class="display" cellspacing="0" width="100%" data-view="backendModule/views/managenews" data-active-view="true"></table>]
I use datatable because it can use ajax datasource, please help me to fix this error or show me some javascript table can use ajax datasource. 我使用datatable是因为它可以使用ajax数据源,请帮助我解决此错误,或者向我展示一些javascript表可以使用ajax数据源。
Try to replace dataTable by DataTable : 尝试用DataTable替换dataTable:
$('#manage-news').DataTable({ options }); $('#manage-news')。DataTable({options});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.