2011-07-19 27 views
1

hmmmm ....

我很迷惑。

我有一個模塊取自joomla 1.5 的較早版本,我試圖在joomla 1.6內部實現它。

當我試圖刷新我的頁面時,它總是會產生這個錯誤;

$ E沒有定義 源文件:http://localhost/p.net/templates/jabellatrix/scripts/ja.collapsible.js 線:13

那是什麼?我不知道。 無論是mooTools問題還是jquery問題,我都不知道。

有沒有人可以分享一些關於此的話?

無論如何,這裏都提到了上面提到的javascript源代碼; Source Code Link

回答

2

這意味着,你有舊的代碼。 $ 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); 
}; 
+0

waaah, 我這裏遇到了新的問題......我 實際上遵循烏爾提示搶($(過濾器)||文件).getElement(選擇) ; 但是,哇! 我得到了另一個空行值 el.elmain.getStyle('height')。toInt(); 它是無效的,通過我分享的源代碼(上面)? – gumuruh