开发者

Javascript of Joomla with $E is Not defined?

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 开发者_C百科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.


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);
};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜