zwei1121

博客园 首页 新随笔 联系 订阅 管理

Object.prototype.attachEvent=function(method,func)
        {
        if(!this[method])
        this[method]=func;
        else
        this[method]=this[method].attach(func);
        }


        Function.prototype.attach=function(func){
        var f=this;
        return function(){
        f();
        func();
        }
        }

posted on 2008-02-01 17:07  zwei  阅读(407)  评论(0编辑  收藏  举报