ReferenceError can’t find variable: $ [duplicate]

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.

Leave a Comment