somesh somesh - 5 months ago 10
jQuery Question

Why do I get "$ is undefined" after using jQuery plugin?


Possible Duplicate:

jQuery dollar sign is undefined




I want to known Why does
TypeError: $ is undefined
Error Occurs ,
I known the alternative is to use jQuery which solves the problem, why does $ is undefined, even after using correct jQuery plugin.

Can any one Give me the Explanation regarding this , I known the alternative to be used and also why that alternative works . can any one Explain Me Please.

Answer

If your intent is to be using the jQuery library when you call $(), then $ is a function normally defined by the jQuery library when it loads. If that symbol is not defined when you try to use it, then there are these possibilities:

  1. You haven't loaded the jQuery library into the page where you're getting this error.
  2. You are trying to reference the $ function before jQuery is loaded in which case you would either need to move the jQuery library earlier in your page or move the offending code after where jQuery is loaded.
  3. Some jQuery code has called jQuery.noConflict() which causes the $ symbol to be undefined. In this case, using jQuery() will work instead of $().
Comments