Url中的Joomla辅助语言代码导致找不到js文件

时间:2014-08-11 16:39:10

标签: joomla adobe-edge

Adob​​e Edge Animate的index_edgePreload.js文件包含以下内容:

aLoader = [
      { load: "templates/mst/edge_includes/jquery-2.0.3.min.js"},
      { load: "templates/mst/edge_includes/edge.4.0.1.min.js"},
      { load: "templates/mst/index_edge.js"},
      { load: "templates/mst/index_edgeActions.js"}];

当我在Joomla中使用辅助语言时,无法找到路径,并且无法显示动画。与ab.com或abc.com/en一起使用,但是当涉及到abc.com/tr:404。一整天都在谷歌搜索。

1 个答案:

答案 0 :(得分:0)

请尝试将您的代码更改为:

aLoader = [
      { load: "<?php echo JURI::base(); ?>templates/mst/edge_includes/jquery-2.0.3.min.js"},
      { load: "<?php echo JURI::base(); ?>templates/mst/edge_includes/edge.4.0.1.min.js"},
      { load: "<?php echo JURI::base(); ?>templates/mst/index_edge.js"},
      { load: "<?php echo JURI::base(); ?>templates/mst/index_edgeActions.js"}];

使用joomla native js addition method会更好。 你的结果将是:

<?php
  $document = JFactory::getDocument();
  $document->addScript('/templates/mst/edge_includes/jquery-2.0.3.min.js');
  $document->addScript('/templates/mst/edge_includes/edge.4.0.1.min.js');
  $document->addScript('/templates/mst/index_edge.js');
  $document->addScript('/templates/mst/index_edgeActions.js');
?>

祝你好运!