Uncaught typeError: Cannot read property 'owlCarousel' of null

I am having a jQuery Issue, Understand I am no jQuery expert so bear with me. I am trying to install this Owl Responsive slider on magento and I am having an issue with this "

Uncaught typeError: Cannot read property 'owlCarousel' of null in Chrome console

Screenshot of Uncaught typeError: Cannot read property 'owlCarousel' of null

Thanks.

Answers:

Answer

By default magento use prototypejs framework which uses $ as global variable. if you include other javascript plugins like jQuery which also use $ as global variable, there will be a clash in variables related to prototypejs and jquery. This conflict can be resolved by assigning different name to global variable of jquery plugin.

To do that, use the following code above in all files wherever you are planning to use jQuery instead of prototype.

jQuery.noConflict();

That means you should use jQuery instead of $. Something like this:

jQuery("#owl-demo");

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.