Search code examples
jquerytablesorter

Plugin not loading


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

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?

Thanks!


Solution

  • jQuery was being loaded twice in that codepen... (updated demo)

    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.

    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.