Search code examples
javascripttwitter-bootstrapscrollspy

$.fn is not an object


I'm trying out using scrollspy with bootstrap, and I'm running into some errors with it. The error console keeps returning this: TypeError: 'undefined' is not an object (evaluating '$.fn'), on line 124 of bootstrap-scrollspy.js, which is this line

var old = $.fn.scrollspy

, which is under the ScrollSpy Plugin Definition. I am using the code directly taken from this jsFiddle

Does anyone know why this is happening?


Solution

  • I would double check two things:

    1. Make sure you're including jQuery before you're including Bootstrap on the page.
    2. Make sure no other libraries (e.g., prototype) are overriding the $ variable.