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 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀