Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

jQuery Conflicts with Magento
 
The State Of Zen
Jr. Member
 
Total Posts:  8
Joined:  2010-06-21
 

Hey guys so here is a site I’m working for my company

I’ve noticed magento uses a customized version of jQuery and thus conflicts with other jQuery scripts I try to incorporate onto the site.
http://216.70.80.64/atlas-products/index.php/ariel/steam-showers/ariel-platinum-dz961f8-steam-shower-7.html

I had to remove
<script type="text/javascript\" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>

from my templates header.phtml to get the Magento jQuery image gallery working.

Please any help would be appreciated! Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tom Robertshaw
Guru
 
Avatar
Total Posts:  485
Joined:  2009-05-17
Bath, UK
 

Hi, Magento uses Prototype, not jQuery and you can’t use both on the same page without them conflicting with each other.

If you want to use jQuery as well, you will need to assign it to it’s own variable in conflict mode. 

var $j jQuery.noConflict();
and then use $j whenever you want to do some jQuery stuff.

Here’s a post with more detail:

http://www.fontis.com.au/blog/magento/using-jquery-magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
The State Of Zen
Jr. Member
 
Total Posts:  8
Joined:  2010-06-21
 

I tried that link you sent me for some reason it still doesn’t work. hmm weird. changed the layout.xml and everything.

 
Magento Community Magento Community
Magento Community
Magento Community
 
magedziner
Sr. Member
 
Avatar
Total Posts:  246
Joined:  2009-09-02
 

You need to use

jQuery.noConflict();
in your jQuery.
and change $ to jQuery to jQuery fields.

And it’s good to call the initialization code in the page, you need the jQuery.

 
Magento Community Magento Community
Magento Community
Magento Community
 
stv315
Jr. Member
 
Total Posts:  8
Joined:  2012-11-21
 

@Tom Robertshaw Thanx for ur great suggestion

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top