if(!window.attachEvent && window.addEventListener)
    {
          Window.prototype.attachEvent = HTMLDocument.prototype.attachEvent=
          HTMLElement.prototype.attachEvent=function(en, func, cancelBubble)
          {
            var cb = cancelBubble ? true : false;
            this.addEventListener(en.toLowerCase().substr(2), func, cb);
          };
    }
那就这段代码好了,是不是浏览器探测来着,window.attachEvent 和window.addEventListener这两个是不是特定浏览器的对象属性.