Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$.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?

like image 200
scrblnrd3 Avatar asked Feb 16 '23 17:02

scrblnrd3


1 Answers

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.
like image 119
Levi Hackwith Avatar answered Feb 18 '23 09:02

Levi Hackwith