【问题标题】:Custom build Mootools implementing in Joomla 1.5在 Joomla 1.5 中实现的自定义构建 Mootools
【发布时间】: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


    【解决方案1】:

    如果您将自己版本的 MooTools 或后续依赖脚本添加到模板的头部,那么您应该进入 Joomla!插件并禁用(取消发布)MooTools 插件。 Joomla! 1.5x 默认使用较旧版本的 MooTools,并且经常与其他库(例如 jQuery 或较新版本的 MooTools)发生冲突。

    另一种选择是使用这样的扩展:

    Disable Joomla! core mootools implementation

    这将允许您关闭由 Joomla! 插入的默认 MooTools 标头标签!模板解析。然后您的网站(内容页面、模块等)应该能够正确利用您插入到头部的自定义 MooTools 和后续脚本。

    干杯

    亚伦

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-12
      • 1970-01-01
      • 2011-08-25
      相关资源
      最近更新 更多