Wednesday, 5 March 2014

$ is not defined

$ is not defined

First this you need check whether jQuery reference has loaded or not.
If not add jQuery reference with correct path.

Another reason:

Make sure all java script code is being run inside a code block such as:

$(document).ready(function () {
  //your code here
});


This will ensure that your code is being loaded after jQuery has been initialized.