问题描述
这真让我发疯.我检查并重写了很多次代码,但仍然无法正常工作.在这里是: http://codepen.io/cwf/pen/zGBmgm
This is driving me nuts. I checked and rewrote the code many times and it still doesn't work. Here it is: http://codepen.io/cwf/pen/zGBmgm
尽管已加载tablesorter.js,但$.tablesorter
是undefined
.我在这里阅读了所有问题,但找不到问题,更不用说解决方案了...必须有一点细节,但我穷尽了所有选择.有人可以快速浏览一下吗?
Although tablesorter.js is loaded, $.tablesorter
is undefined
. I read all the questions here and can't find the problem, let alone the solution...Must be a little detail but I exhausted all options. Can anybody please have a quick look?
谢谢!
推荐答案
jQuery在该Codepen中被加载了两次...(更新了演示)
jQuery was being loaded twice in that codepen... (updated demo)
在<head>
jquery v2.1.4的加载中,在文档底部,在加载Bootstrap脚本的位置旁边,加载了jQuery v1.11.2.
In the <head>
jquery v2.1.4 is being loaded, and at the bottom of the document, next to where Bootstrap scripts are loaded, jQuery v1.11.2 is loaded.
当jQuery加载两次时,在两个版本之间加载的所有脚本都将与jQuery&的第一个副本相关联.任何已加载的脚本.除非使用 noConflict()
,否则jQuery的第二个副本将覆盖第一个副本.但是在同一页面上运行两个版本的jQuery是很愚蠢的.
When jQuery is loaded twice, any scripts that are loaded between to the two versions will be associated with the first copy of jQuery & any loaded scripts. The second copy of jQuery will overwrite the first unless noConflict()
is used; but it is kind of silly to run two versions of jQuery on the same page.
这篇关于插件未加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!