Back to Top

Solution: Uncaught ReferenceError $ is not defined in WordPress

Uncaught ReferenceError: $ is not defined in Wordpress

As you all know, new version of WordPress (3.5) includes its own version of jQuery, which has been rigorously tested with WP and many of the most common plugins in order to provide the best compatibility and experience for WordPress users.

So When I have added my jQuery code into my theme, I got the following error

I was surprised with this error generated into the console but after that I just checked jQuery by viewing source and got the solution

Keep in mind: Offloading the default jQuery and other scripts to Google is similarly disallowed. If your code doesn’t work with the built-in jQuery, it’s most likely a no conflict issue. If you can’t, we need to know why so we can fix things for everyone.

Solution:

Well, there’re a few problems with jQuery code.However, the main reason I am getting jQuery issues is that I need to put jQuery no-conflict wrappers around the code

I need to add

to the top of code, and add this:

To the bottom. This allows the $ character to be defined as the jQuery object.

That’s it.You are done.!! 🙂

Hope this post will helpful for you, waiting for your responses.Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Share:
Share on Facebook0Share on LinkedIn0Tweet about this on TwitterShare on Google+0Buffer this pageDigg thisShare on Reddit0

Comments (1)

  1. Perfectly worked for me. Thankyou Bhumi

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular Posts

To prevent caching in web browser

Posted on 5 years ago

Bhumi

How to add Sorting columns in Joomla

Posted on 4 years ago

Bhumi

how to use the CSS3 Gradient Effect

Posted on 5 years ago

Zinal

Facade implementation in Laravel

Updated 3 weeks ago

Bhumi

MySQL coalesce() function

Updated 17 years ago

Bhumi

How to use JavaScript Promise API?

Updated 17 years ago

Bhumi

What are Lambdas and Closures in PHP?

Updated 17 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 3 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 3 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 3 years ago

Bhumi