【发布时间】:2011-09-06 18:54:25
【问题描述】:
我尝试将 JQuery 库包含到 joomla 中,但它不起作用。许多组合和模块在我的 CMS 中使用 mootools。我认为问题是两个框架之间的冲突。
我在网上搜索了一些文章,但是下面的代码仍然没有按预期工作。
<?php
JHTML::stylesheet('demo_page.css', 'media/system/css/');
JHTML::stylesheet('ftab.css', 'media/system/css/');
JHTML::stylesheet('demo_table.css', 'media/system/css/');
$option="com_mycomp";
$base=JUri::root().'components/'.$option.'/js/';
$document=&JFactory::getDocument();
$noConflict="jQuery.noConflict();";
//$document->addScriptDeclaration($noConflict);
$document->addScriptDeclaration("jQuery(document).ready(function($){jQuery('#example').dataTable();});");
JHTML::script('jquery.js',$base,true);
$document->addScript($base,'jquery.js');
$document->addScript($base,'jquery.dataTables.js');
?>
这应该使用 JQuery 对我的表进行排序,但它没有。
如何在 joomla 中同时使用 mootools 和 jQuery?
提前感谢您的帮助!
【问题讨论】:
标签: javascript jquery mysql frameworks mootools