aiContactSafe上的Mootools和jQuery冲突

aiContactSafe上的Mootools和jQuery冲突

本文介绍了如何修复Joomla aiContactSafe上的Mootools和jQuery冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

概述

我有一个Joomal 2.5网站,其中 AiContactSafe 已安装联系表格.标准AiContactSafe作为component起作用,这意味着,我不能在文章中包含联系表格,它已包含在我网站上的整个页面上.

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有一个名为 AiContactSafeForm 的插件,该插件使用户能够使用{aicontactsafeform pf=3}之类的标签将表单添加到页面中.数字3是表单的ID.这样做的好处是,它使用户可以将表单添加到文章中.该插件使用MooTools.

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.

问题

只要我的页面上没有jQuery,它就可以正常工作.当我使用jQuery时,它与MooTools库发生冲突,使我的网站停滞不前.

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.

问题

如何解决jQuery冲突.我尝试在jQuery.1.8脚本之后将$.noConflict()添加到页面顶部,但这不能解决问题.有没有人遇到过同样的问题?有人可以帮我解决这个问题吗?多谢你们.

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.

推荐答案

尝试通过以下代码添加noConflict:

Try adding the noConflict via this code:

$document = JFactory::getDocument();
$document->addScript( '[path to jquery]' );
$noconflict = 'jQuery.noConflict();';
$document->addScriptDeclaration( $noconflict );

这篇关于如何修复Joomla aiContactSafe上的Mootools和jQuery冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 08:30