是不是FIREFOX的问题呢,加上下面几句就可以兼容FIREFOX了,因为FIREFOX里没有attachEvent还有就是把事件加在TD上再试试,不要加在TR上
//attachEvent 2 ref
HTMLElement.prototype.attachEvent = function(EventStr,EventFun){ 
       this.addEventListener(EventStr.substring(2), EventFun, false);
};
//attachEvent 3 ref
HTMLElement.prototype.attachEvent = function(EventStr,EventFun,Sboolean){ 
       this.addEventListener(EventStr.substring(2), EventFun, Sboolean);
};//detattachEvent 2 ref
HTMLElement.prototype.detattachEvent = function(EventStr,EventFun){ 
       this.removeEventListener(EventStr.substring(2), EventFun, true);
};
//detattachEvent 3 ref
HTMLElement.prototype.detattachEvent = function(EventStr,EventFun,Sboolean){ 
       this.removeEventListener(EventStr.substring(2), EventFun, Sboolean);
};

解决方案 »

  1.   

    addEvent("window","load",方法名[不需要引号]);function addEvent(elm, evType, fn, useCapture)
        {
          if (elm.addEventListener){
            elm.addEventListener(evType, fn, useCapture);
            return true;
          } else if (elm.attachEvent){
            var r = elm.attachEvent("on"+evType, fn);
            return r;
          } else {
            alert("Handler could not be removed");
          }
        }