Solved

MooTools - Open Cart/JQuery conflict

Posted on 2013-01-25
6
711 Views
Last Modified: 2013-02-03
I've got a couple of MooTools scripts (a lightbox and a open/close panel script) running on the same page as the JQuery scripts for Open Cart on a Joomla site.

The MooTools scripts run great on all of the non-Open Cart pages, but they throw an exception on the e-commerce pages.

I've tried to use jQuery.noConflict() as per this article on StackOverflow, but it's not giving me any joy yet.

The see scripts and exceptions in action here.

It's a dev site; logins are available for closer inspection.

Help greatly appreciated.
Dan
0
Comment
Question by:DanGilmore
  • 3
  • 3
6 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 100 total points
ID: 38821911
Put you script tag inside HEAD Section
<link href="/jenkins/templates/jenkins/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
  <link rel="stylesheet" href="http://loudandcleardesign.com.au/jenkins/components/com_chronoforms/css/frontforms.css" type="text/css" />
  <script src="/jenkins/components/com_opencart/catalog/view/javascript/jquery/jquery-1.7.1.min.js" type="text/javascript"></script>
  <script src="/jenkins/components/com_opencart/catalog/view/javascript/common.js" type="text/javascript"></script>
  <script src="/jenkins/components/com_opencart/catalog/view/javascript/jquery/jquery.cycle.js" type="text/javascript"></script>
  <script src="/jenkins/media/system/js/mootools-core.js" type="text/javascript"></script>
  <script src="/jenkins/media/system/js/core.js" type="text/javascript"></script>
  <script type="text/javascript">jQuery.noConflict();</script>
  <script src="/jenkins/media/system/js/mootools-more.js" type="text/javascript"></script>
<script src="http://jenkinsconsultancy.com.au/templates/jenkins/js/fitimage.js"></script>
<script>new FitImage('http://jenkinsconsultancy.com.au/images/background2.jpg');</script><script src="http://jenkinsconsultancy.com.au/templates/jenkins/js/panel-toggle.js"></script>

Open in new window

0
 

Author Comment

by:DanGilmore
ID: 38823181
I've moved all scripts from the bottom of the page to the top; that hasn't solved the problem.

As an aside, I thought it was good practice to put scripts at the bottom of the page to allow other page assets to load faster..?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38823191
I put noconflict between jquery scriptSS and mootools scriptSS
You put it at the end :((
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:DanGilmore
ID: 38823231
Thanks Leakim - will try that as soon as I figure out how to move that auto-generated noConflict call. I've never been able to figure out how to re-order the scripts called by addScript/getHeadData
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38823235
ok and don't it going to work after, you need to move other scripts in the body and place some of them in a $(document).ready(function() {}) block
but here we go step by step
0
 

Author Closing Comment

by:DanGilmore
ID: 38849556
The answer told me ~what~ to do, which is great. But after further questioning, I still have no idea ~how~ to make the necessary changes. Ended up hiring a freelancer on another site to fix the problem.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 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

15 Experts available now in Live!

Get 1:1 Help Now