Skip to content

Instantly share code, notes, and snippets.

@phproberto
Last active December 28, 2015 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phproberto/7473480 to your computer and use it in GitHub Desktop.
Save phproberto/7473480 to your computer and use it in GitHub Desktop.
Load jQuery for Joomla! 2.5 - 3.x
<?php
if (version_compare(JVERSION, '3.0', '<'))
{
if (JFactory::getApplication()->get('jquery') !== true)
{
// Load jQuery in no conflict mode with B/C support
JHtml::script(JUri::root() . 'templates/joostrap/js/jquery.min.js');
JHtml::script(JUri::root() . 'templates/joostrap/js/jquery-migrate.min.js');
JHtml::script(JUri::root() . 'templates/joostrap/js/jquery-noconflict.js');
JFactory::getApplication()->set('jquery', true);
}
}
else
{
JHtml::_('jquery.framework');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment