Joomla 的 Javascript 与 $E 未定义?

发布于 2024-11-25 03:04:09 字数 501 浏览 0 评论 0原文

嗯……

我有点困惑。

我有一个取自 joomla 1.5 早期版本的模块 我试图在 joomla 1.6 中实现它。

当我尝试刷新页面时, 它总是会产生这个错误;

$E 未定义 源文件: http://localhost/p.net/templates/jabellatrix/脚本/ja.collapsible.js 线路:13

那是什么?我不知道。 我不知道这是mooTools问题还是jquery问题。

有没有人可以分享一下这件事?

不管怎样,上面提到的 javascript 源代码来了; 源代码链接

hmmmm....

I'm abit confused.

i have a module taken from the earlier of joomla 1.5
that I tried to implement it inside joomla 1.6.

When I tried to refresh my page,
it will always generate this error;

$E is not defined
Source File: http://localhost/p.net/templates/jabellatrix/scripts/ja.collapsible.js
Line: 13

What is that?? I dunno.
Whether it is a mooTools problem or jquery problem i dunno.

Is there anyone could share a bit of words about this?

anyway here comes the javascript source code that's mentioned above; Source Code Link.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静水深流 2024-12-02 03:04:09

这意味着,您有旧代码。 $E 来自 mootools 1.1x,它引用 document.getElement("selector"); 返回第一个匹配的元素。您可以选择:

$E = document.getElement; 希望它能够兼容,或者查看另一个更新的可折叠脚本。很可能 - 这不会是唯一的重大 API 更改。

完整的代码是:

/* 
Function: $E
    Selects a single (i.e. the first found) Element based on the selector passed in and an optional filter element.
    Returns as <Element>.

Arguments:
    selector - string; the css selector to match
    filter - optional; a DOM element to limit the scope of the selector match; defaults to document.

Example:
    >$E('a', 'myElement') //find the first anchor tag inside the DOM element with id 'myElement'

Returns:
    a DOM element - the first element that matches the selector
*/

function $E(selector, filter){
    return ($(filter) || document).getElement(selector);
};

it means, you have old code. $E is from mootools 1.1x and it refers to document.getElement("selector"); to return the first matching element. you can either go:

$E = document.getElement; in the hope it makes it compatible or look at another collapsible script that is more up-to date. chances are - this wont be the only breaking api change.

the full code was:

/* 
Function: $E
    Selects a single (i.e. the first found) Element based on the selector passed in and an optional filter element.
    Returns as <Element>.

Arguments:
    selector - string; the css selector to match
    filter - optional; a DOM element to limit the scope of the selector match; defaults to document.

Example:
    >$E('a', 'myElement') //find the first anchor tag inside the DOM element with id 'myElement'

Returns:
    a DOM element - the first element that matches the selector
*/

function $E(selector, filter){
    return ($(filter) || document).getElement(selector);
};
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文