firefox不支持attachEvent,attach

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

原文地址:https://www.cnblogs.com/zwei1121/p/1061631.html