News:

Looking for documentation? Take a look on our wiki

Main Menu

jQuery conflicts

Started by toad78, December 17, 2012, 19:11:06 PM

Previous topic - Next topic

toad78

I'm running the 'Superfish' menu module which requires jQuery. I'm also running VM2.014, which also requires jQuery.

I've noticed some things that don't make sense, but maybe someone else can.

We have one template for the same site that does not have more than one jQuery conflict. The menu module shows the arrows for the main menu items that have submenus. Superfish's jQuery call is the only one running.

But on another template for the same site where Virtuemart is running, there are two instances of it. One from the menu module and the other from VirtueMart. So we disabled the 'Using the VirtueMart jQuery'. Unfortunately, this caused the 'Add to Cart' button to not function correctly. You can click the button, but nothing would be added to the cart when you view the cart page. So I re-eneabled it.

Obviously we can't run more than one jQuery and both the menu module and VM (2.2014) need to be functional.

How can we run the two without both jQuery's running?

bytelord

Hello,

To load only one jquery instance, either vm or your template or your other components that loads jquery. Prefer jquery 1.7.x for vm2.
You could use also any free plugin that controls the jquery loading, like jquery easy: http://extensions.joomla.org/extensions/core-enhancements/performance/jquery-scripts/18327

btw, any live URL to test it also?

Use firebug to examine your site code and styling .. also for checking js conflicts ... http://forum.virtuemart.net/index.php?topic=102850.0

Javascript conflicts:
http://dev.virtuemart.net/projects/virtuemart/wiki/General_JS-Problems_with_templates_and_jQuery
http://dev.virtuemart.net/projects/virtuemart/wiki/JavascriptCSS_Template_Overrides_and_Avoiding_Conflicts_between_Libraries

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

toad78


bytelord

Hello,

I remember your site we have seen it again ... you are loading jquery twice ... probably from k2 or from the module: mod_jt_superfish_menu
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

Unload it :)

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

toad78

Yes, I have done that. And when I do that, the template that does not use VM causes the drop down arrows to disappear. Therefore, I obviously need jQuery to load on the template that does not run VM.

bytelord

If you unload vm2 jquery is it working? But your should load the jquery.noConflict....

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

toad78

Done that, too and it causes the 'Add to Cart' button not to work in the 'Product Details' screen.

bytelord

Hello,

Then could use jquery easy and load only one library with it ... jquery 1.7.x and jquery noConflict also...

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!