dongqin1819 2012-07-13 01:51
浏览 95
已采纳

Joomla 2.5没有通过文章加载JS脚本?

In Joomla 2.5 I have installed DirectPHP, which I have used extensively in Joomla 1.6 to embed PHP in Joomla articles. It works very well. I usually just for one include in the article, like this:

<?php
    include "my_cool_script.php";
?>

Then I make my code in my_cool_script.php. One thing I often do is include more JS or CSS scripts in the page, right through the article, but putting the following lines in my_cool_script.php:

<link rel="stylesheet" type="text/css" media="screen" href="/scripts/css/dark-hive/jquery-ui-1.8.21.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/scripts/css/ui.jqgrid.css" />
<script src="/scripts/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="/scripts/js/jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>
<script src="/scripts/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="/scripts/js/jquery.jqGrid.src.js" type="text/javascript"></script>

This has always worked in the past, with Joomla 1.6. Now in the Joomla 2.5 install. The rest of the PHP and HTML is loading in the article, and there aren't any errors on the page as far as loading the scripts. I look at the HTML code and I can see the above lines written to the page, but I cannot access any of the jQuery functions, like the script was not loaded. I get an error when I try to use any jQuery syntax. I know this script was working, because I just moved it from another site, running joomla 1.5 to the new one, 2.5.

Does anyone know anything about why the scripts aren't loading?

EDIT

Well i guess the script was loading, but it didn't like that used the $ symbol. I changed them all to jQuery and it works.

  • 写回答

2条回答 默认 最新

  • douyi6168 2012-09-19 17:32
    关注

    I am not sure exactly why, but perhaps in my installation there is some conflict, and the $ symbol is being recognized as it usually does, signifying that we are dong jQuery. So I changed all the $ to jQuery in my PHP scripts and all the jQuery seems to be working now.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答