首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >初始化时出现jQuery TableSorter插件错误:无法读取未定义的属性'0‘

初始化时出现jQuery TableSorter插件错误:无法读取未定义的属性'0‘
EN

Stack Overflow用户
提问于 2012-01-16 18:51:08
回答 5查看 27.1K关注 0票数 17

我想用jQuery插件TableSorter对我的表进行排序。所以我得到了这个表:

<table id="stats" class="zebra-striped">
 <thead>
  <tr>
   <th>Date</th>
   <th>Annonce</th>
   <th>Support</th>
   <th>Nb Assoc.</th>
   <th>Nb Transfo.</th>
   <th>Cout</th>
  </tr>
 </thead>
 <tbody>
 </tbody>
</table>

所以你可以看到我的表是空的,只有一个标题。所以我用空单元格初始化表排序:

$("table#stats").tablesorter({ sortList: [[0,0]]});

我马上就得到了这个错误:

jquery.tablesorter.min.js:4 Uncaught TypeError: Cannot read property '0' of undefined

仅供参考,这是我的js加载:

<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.5.1.min.js">\x3C/script>')</script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/bootstrap-scrollspy.js"></script>
<script src="js/jquery.tablesorter.min.js"></script>

你知道为什么我会得到这个插件,以及怎样才能让插件再次工作吗?

Thx

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8878945

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档