Uncaught Reference Error: jQuery is not defined

On fast few days, I was working on site of my employer and I’m using different kind of jQuery plugin and custom jQuery code for different site functionality and unfortunately I’m getting jQuery error “Uncaught Reference Error: jQuery is not defined” okay so the error seems easy right? All we need to do is just include the main jQuery library which we can find anywhere in the web in Google CDNMicrosoft CDNjQuery CDN or hosted in your own server.

Okay now the error is gone but I found another errors in other jQuery file in custom jQuery and jQuery plugin, that says “Uncaught Reference Error: $ is not defined” and “Uncaught TypeError: Property ‘$’ of Object[object DOMWindow] is not a function“, so I begun debugging it myself and the safest way to solve and rid this problem is to use jQuery conflict, in your custom code or plugin jQuery file just copy the format in the code below.


You need to replace all default “$” variable to your new variable in our case “rys”.

To find more information about jQuery conflict visit their site at jQuery.com.

by Ryan Sutana

  • I think much more people need to read blogs like this. Its so important to know how you can construct an excellent weblog to get men and women interested and youve carried out just that. The content is fantastic, the videos are ideal for what youre trying to say. Awesome, man. Actually awesome! Cant wait to read more.

  • Ronak Parmar

    Hey, Thanks for giving the demo code its really helpful to better understand the problem.
    But, i am new in joomla so, i don’t have idea which should include to solve this problem.
    please let me know if you know.

  • Thanks for your reply,
    i have checked my code,
    and included this line of code “JFactory::getDocument()->addScript(‘media/jui/js/jquery.min.js’);”
    and its work working fine.
    Thanks again.

    • I’m glad you got it sorted 🙂