Hello readers, today I guide you "to import jQuery in Joomla"
This can be a rule which we all utilize to guarantee that only 1 content involving jQuery can be imported. The idea merely tests to see in the event jQuery is already been imported and if not necessarily, subsequently we all have significance of the item.
You can use the below code for practice:
if(!JFactory::getApplication()->get('jquery')){
JFactory::getApplication()->set('jquery',true);
$document = JFactory::getDocument();
$document->addScript(JUri::root() . "templates/template_name/js/jquery.js");
}
In joomla 3.x (no conflict mode):
JHtml::_('jquery.framework');
Joomla 3.x (normal mode):
JHtml::_('jquery.framework', false);
0 Comment(s)