问题
Overview
I have a Joomal 2.5 website with AiContactSafe contact form installed. Standard AiContactSafe
works as a component
which means, I cannot include a contact form into an article, it has be on its on taking the whole page on my website.
AiContactSafe has a plugin called AiContactSafeForm which enables users to add a form into a page using a tag like {aicontactsafeform pf=3}
. Number 3
is the id of the form. And what this does is, it enables users to add a form into an article. This plugin uses MooTools.
Issue
This works fine as long as I have no jQuery on my page. And when I have jQuery, it clashes with the MooTools library braking my website.
Question
How do I fix the jQuery clash. I tried adding $.noConflict()
to the top of the page after jQuery.1.8
script but this doesnt fix it. Has any one come across this same issue? Can someone help me to figure this out? Thanks guys.
回答1:
Try adding the noConflict via this code:
$document = JFactory::getDocument();
$document->addScript( '[path to jquery]' );
$noconflict = 'jQuery.noConflict();';
$document->addScriptDeclaration( $noconflict );
来源:https://stackoverflow.com/questions/13040218/how-to-fix-mootools-and-jquery-conflict-on-joomla-aicontactsafe