mootools $ clear未定义

Ste*_*Ste 2 mootools timer

我有错误:$ clear没有定义..这段代码有什么问题?我使用Mootools 1.4.5:

var test = new Class({
    initialize: function(){},


    init: function(){
        var timer;
        $$('#list tr').addEvents({
            'click': function(){
                $clear(timer);
                timer = (function(){
                    console.log('clicked');
                }).delay(200, this);
                },
                'dblclick': function(){
                    $clear(timer);
                    console.log('dblclicked');
                }

            }); 
    }
});
Run Code Online (Sandbox Code Playgroud)

谢谢!

Rob*_*gar 7

$clear不推荐使用,因为它只是复制了内置clearTimeout函数.我猜它现在已被删除.

编辑:不推荐使用的函数仅包含在Mootools 1.45的"兼容性"版本中