【发布时间】:2011-06-22 06:48:54
【问题描述】:
大家好.. 有人可以指导我如何在 Joomla 1.5 中实现我的自定义 mootools..
我在下面有这些文件
PHP 文件
- promocode.php
CSS(用于我的 js)
- sexyalertbox.css
Javascript
- mootools1.js
- mootools-more.js
- sexyalertbox.v1.js
- sexyalertbox.packed.js
- jquery
我设法将 php 文件放在我在 joomla 中的一个组件中,即 ignite_gallery 并像我想要的那样显示它。但我唯一缺少的是我的 mootools 根本无法工作,不像我从 Joomla 之外的根文件运行它。
我使用的是 Joomla 1.5.22,我的 mootools 版本是 1.2,我使用的是 rhuk_milkyway 模板
我已经尝试过的解决方案是在我的 php 文件中声明以下代码
<?php
$document =& JFactory::getDocument();
$document->addStyleSheet("/Joomla/media/system/css/sexyalertbox.css");
$document->addScript("/Joomla/media/system/js/mootools1.js");
$document->addScript("/Joomla/media/system/js/sexyalertbox.v1.js");
/////// i cut some lines and i just point out where i used the javascript////
if(!empty($promocode)){
$message= "<font color='#FF0000'></br> <b>Successfully Save!</b> </font> <script type='text/javascript'>
window.addEvent('domready', function() {
Sexy = new SexyAlertBox();
Sexy.info('<h1>Company Inc.</h1></br></br><b>Successfully Save!<b></br>');
});
</script>";
}
?>
我也尝试将这些脚本放在 C:\xampp\htdocs\Joomla\templates\rhuk_milkyway\index.php 中
<head>
<jdoc:include type="head" />
<script type="text/javascript" src="<?php echo $this->baseurl ? >/media/system/js/mootools1.js"> </script>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/media/system/js/sexyalertbox.v1.js"> </script>
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/media/system/css/sexyalertbox.css" type="text/css" />
</head>
突然没有运气..它仍然无法正常工作..请帮助我..
我们极力寻求任何建议或建议。愿上帝保佑,祝你有美好的一天。
【问题讨论】:
标签: php javascript joomla mootools joomla1.5