?
Solved

MooTools - Open Cart/JQuery conflict

Posted on 2013-01-25
6
Medium Priority
?
719 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 200 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
Stressed Out?

Watch some penguins on the livecam!

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

765 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