jQuery not loading (Uncaught ReferenceError: $ is not defined)

Posted on 2012-09-14
Last Modified: 2012-09-15
I am using Flexislider to showcase products in my Magento store. Everything was working fine then it just Stopped showing on the hompage.

Using the Chrome inspector I have identified the following errors but have not idea how to fix as I am very new to jQuery and Magento. I am also using a callapsable menu which has also failed to load...

I really hope someone can help me PLEASE!!!

Uncaught ReferenceError: $ is not defined

Uncaught TypeError: Object [object Window] has no method 'load' :

Uncaught TypeError: Object [object Object] has no method 'mobileMenu'

Uncaught TypeError: Object [object Object] has no method 'flexslider'
Question by:rafique12
    LVL 8

    Expert Comment

    The '$ is not defined' means jquery is not 'running'.

    Check your script include for JQuery.

    If you are using Google's CDN it could/should look like this:
    <script src="" type="javascript"></script> 

    Open in new window


    Author Comment

    Thanks for the response, I have jquery-1.7.2.min.js being called in the header of my site. There are three other elements on the page that rely on jQuery which are working its just the product slider and mobile menu...

    LVL 42

    Accepted Solution

    By default, Magento uses the Prototype library which also hooks the $ sign for it's own use. You will need to call the noConflict() function of jQuery, and then in your jQuery functions, use jQuery instead of $. Some of this may already have been taken care of in your other jQuery scripts.

    Something like this:

    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
         jQuery(document).ready(function($) {
              //now you're inside the ready function you can use the $ for the jQuery object 
              var myValue = $('#someElement').val(); //normal jQuery stuff.
         //if you use the $ outside of the jQuery it will refer to your other library, not jQuery.

    Open in new window

    Do a search for jQuery in Magento for more info...

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
    In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now