Friday, June 3, 2011

Jquery No Confilict in Joomla


In admin
$document =JFactory::getDocument();
$document->addScript('location_to_jquery/jquery-min.js');
$scripts = "jQuery.noConflict()";
$document->addScriptDeclaration($scripts);

In Site from Template

[script type="text/javascript" src="[?php echo $this->baseurl ;?>/templates/[?php echo $this->template?>/js/jquery-min.js"]
jQuery.noConflict();
[/script >
// insert this code inside the [head> tag before [jdoc:include type="head" > tag


From Module or Component

$document = JFactory::getDocument();
$document->addScript('location_to_jquery/jquery-min.js');
$scripts = "jQuery.noConflict()";
$document->addScriptDeclaration($scripts);

No comments:

Post a Comment