Categories
Joomla

Import jQuery files into Joomla Without Conflict

Joomla content management system is one of the most preferred CMS over the Internet. Joomla comes with Mootools. You need to import jQuery into Joomla. But, while importing jQuery there may be times when you have to face problems like:

  • Importing jQuery in each module makes the site very slow.
  • It crashes while importing jQuery into Joomla.

How to Import jQuery into Joomla

In order to simplify the process to import jQuery into Joomla, use the following code.
For Joomla 1.5 to Joomla 2.5.x you can add the following code to the index.php file of your template

<?php 
if(!JFactory::getApplication()->get('jquery')){
JFactory::getApplication()->set('jquery',true);
$document =JFactory::getDocument();
$document->addScript(JURI::root() . "templates/template_name/js/jquery-1.8.2.js"); }
?>

This code ensures that only one jQuery is loaded at a time. So this prevents the site from being slow. In case you face any difficulty to import jQuery in Joomla, request a quote. Our team of professional will assist you in the process.