代码: if(!isIE){ window.constructor.prototype.__defineGetter__("event",function(){ var func = arguments.callee.caller; while(func != null){ var arg0 = func.arguments[0]; if(arg0 && (arg0.constructor==Event || arg0.constructor ==MouseEvent)){ return arg0; } func = func.caller; } return null; }); Event.prototype.__defineSetter__("returnValue",function(b){ if(!b)this.preventDefault(); return b; }); Event.prototype.__defineGetter__("srcElement",function(){ var node=this.target; while(node.nodeType != 1)node=node.parentNode; return node; }); Event.prototype.__defineGetter__("offsetX",function(){ return this.layerX; }); Event.prototype.__defineGetter__("offsetY",function(){ return this.layerY; }); HTMLElement.prototype.attachEvent = function(sType,foo){ this.addEventListener(sType.slice(2),foo,false); } HTMLElement.prototype.detachEvent = function(sType,foo){ this.removeEventListener(sType.slice(2),foo,false); } HTMLDocument.prototype.attachEvent = function(sType,foo){ this.addEventListener(sType.slice(2),foo,false); } HTMLDocument.prototype.detachEvent = function(sType,foo){ this.removeEventListener(sType.slice(2),foo,false); } HTMLElement.prototype.__defineGetter__("innerText",function(){ return this.textContent; }); HTMLElement.prototype.__defineSetter__("innerText",function(str){ this.textContent = str; }); } else document.execCommand("BackgroundImageCache",false,true);