also tested Opera 7.23, 8.10, 9.23, 9.24, 9.25; Navigator 4.6, 4.75, 7.0, 8.0
also tested SeaMonkey 2.0a1pre; Firefox 1.0.4, 1.5.0.13pre, 2.0.0.11; Opera 9.25, 9.26; Galeon 1.3.20; Epiphany 2.18; Iceweasel 2.0.0.3; GranParadiso 3.0; Iceape 1.1.5; Kazehakase 0.2.7, 0.4.3; BonEcho 2.0.0.12; Flock 1.0.9; Minefield 3.0b4pre; Epiphany 2.14.3
... but if you interested in detailed comments, you will find them in the source code of this document.
// thanks!:) original from http://dean.edwards.name/weblog/2005/10/add-event/ // with input from Tino Zijdel, Matthias Miller, Diego Perini, Tanny O'Haley, Hedger Wang // Author: Dr. Dirk Fischer, Köln/Cologne, Germany : Tested with www.browsershots.org : thanks! // Version 1.2 function addEvent(o,t,h){ var s=/chrome/i.test(navigator.userAgent)?false:window.execScript?1 :/WebKit|Khtml/i.test(navigator.userAgent)||window.opera&&!window.getSelection?2 :document.addEventListener?false:1, d="domcontentloaded"; if (!o)return false; if (o.addEventListener&&!(s&&t.toLowerCase()==d))o.addEventListener(t,h,false); else{ t=t.toLowerCase(); if (t==d||(t=='load'&&(!o.nodeType||o.nodeType==9))){o=s==2?document:window; if (addEvent.waitDOM==-1){addEvent.waitDOM=s;DOMloadWait(); document.write('body{background-image:url(null);} ');}} if (!h.$$guid)h.$$guid=addEvent.guid++; if (!o.evs)o.evs={}; var hs=o.evs[t]; if (!hs){hs=o.evs[t]={};if (o['on'+t])hs[0]=o['on'+t];} hs[h.$$guid]=h;o['on'+t]=handleEvent; } function DOMloadWait(){ (function(){ if (addEvent.waitDOM>0){var b=document.body; if (b){var o=addEvent.waitDOM==2?document:window, d="domcontentloaded";addEvent.waitDOM=0; if (b.onload){addEvent(window,'load',b.onload); if (o===document)b.onload=null; o.onload=handleEvent;} (o["on"+d])({"type":d}); o=document.getElementById("JustForLoad");o.parentNode.removeChild(o);} else setTimeout(arguments.callee,10); }})();} } addEvent.guid=1; addEvent.waitDOM=-1; function removeEvent(o,t,h){ if (o.removeEventListener)o.removeEventListener(t,h,false); else if (o.evs&&o.evs[t]&&h.$$guid)delete o.evs[t][h.$$guid]; } function handleEvent(ev){var r=true; ev = ev||fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event); var hs=this.evs[ev.type]; for(var i in hs){ this.$$h=hs[i]; if(this.$$h(ev) === false)r=false; } if (this.$$h)this.$$h=null; return r; } function fixEvent(ev){ if (ev){ev.preventDefault=fixEvent.preventDefault;ev.stopPropagation=fixEvent.stopPropagation;} return ev;} fixEvent.preventDefault=function(){this.returnValue=false;} fixEvent.stopPropagation=function(){this.cancelBubble=true;}
Footer: thank's Tanny O'Haley for the base of this test site