Theme Joomla Tips and Advice
Running mootools and jQuery side-by-side
If you are running both the mootools and jQuery JavaScript libraries on your website and are getting JavaScript conflicts this tutorial will show you how to correctly set up the two JavaScript libraries in your template and it will allow you to have an endless amount of mootools and jQuery powered extensions running on your website.
This process might seem daunting but there are actually only two things you need to do here: Adding 4 lines of code before
- Firstly, we have to remove all calls to the mootools and jQuery framework library files:
- Some extensions have an option to Enable or Disable the call to mootools and/or jQuery framework file.
- If so, great! Just set those to Disabled. In Kupo Slides Pro for example, you can disable the jQuery library call - In the Kupo Control Panel go to Extension Manager and click on settings for Kupo Slides Pro and set Use Included jQuery to No.
- If not, then you are going to have to manually dig into the code and remove them. Inside your template's index.php file search for 'mootools.js' or 'mootools-core.js' and 'jQuery.js' or 'jQuery.min.js' or something to that effect and you must remove the entire line. For extensions such as components, modules and plugins they are usually called in the main php file which should be the same name as the extension (i.e. Kupo Slides Pro has a module called mod_kuposlidespro and there is a file called mod_kuposlidespro.php - this file normally has the call to the mootools or jQuery framework file).
- Here are a few examples of how they might look:
<script type="text/javascript" src="media/system/js/mootools-core.js"></script>
<script type="text/javascript" src="media/system/js/mootools-more.js"></script>
<script type="text/javascript" src="templates/bedrock/js/jquery.min.js"></script>
- Now open up your template's index.php file.
- Search for <jdoc:include type="head" /> and add the following just before it:
<?php $this->_scripts = array(); ?>
<script type="text/javascript" src="/plugins/system/mtupgrade/mootools.js"></script>
<script src="[path_to_jquery_file]/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">jQuery.noConflict();</script>
Remember to set the '[path_to_jquery_file]/jquery.min.js' to your jQuery framework path. Best to set it to your template's jQuery file. If the template does not call jQuery then use the path to one of your extensions
e.g.<script src="modules/mod_kuposlidespro/js/jquery/jquery.min.js" type="text/javascript"></script>
That is it! You should be able to install and run multiple mootools or jQuery powered extensions on your website without hassle.
- Favored Friends Partner Program
- Favored Friends Partner Program
-
http://www.searchenginexperts.com.au -
http://www.made-in-china.com/ -
http://www.alllondonescorts.com -
http://www.flash-decompiler.com/ -
http://www.presspixels.com -
http://www.6000year.com -
www.wholesalehandbags11.com - Favored Friends Partner Program
-
http://www.directorius.net/ -
http://www.allsmiles.com/ -
http://directory.ac -
http://www.digitalbroadcasters.co.uk -
http://www.swf-to-fla.net/ -
http://www.dirwebguide.com -
www.dbestdir.com -
http://www.dirtopweb.com - Favored Friends Partner Program
- Favored Friends Partner Program
- Favored Friends Partner Program
- Favored Friends Partner Program
- Favored Friends Partner Program
- Favored Friends Partner Program
- Favored Friends Partner Program
-
http://www.igogo.es -
http://www.gadgetsdealer.com
With a Google Page Rank of 6 and an Alexa world global ranking of 82,336 you should become a favored friend and get your site noticed!
Latest Releases
Payment Options
All secure payments and purchases are processed through our main holding company Site Source Solution via PayPal or 2checkout.com. All major credit cards are also accepted.
The Green Button
We often get donations for the extra support we give, if you wish to donate you can do so using the button below. All donations go to the green button initiative which uses donations for charities and ecological organizations.
connect with facebook stay current through twitter