Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReferenceError can't find variable: $ [duplicate]

Possible Duplicate:
ReferenceError: Can’t find variable: $

I get this error:

ReferenceError: Can't find variable: $

Any ideas?

like image 369
none Avatar asked Feb 03 '11 16:02

none


1 Answers

Is the jquery javascript file loaded before you call anything with it -> using the selector $? Please check with Chrome or Firefox+firebug if the jquery library is loaded correctly. Maybe the path could be not correct

After that, try to place your code into:

$(document).ready(function() {
  // put all your jQuery goodness in here.
});

This will make sure that '// put all your jQuery goodness in here.' will be executed after jQuery has been loaded.

like image 101
RvdK Avatar answered Sep 20 '22 14:09

RvdK