DOMContentLoaded Sample Page

alert log

large image

Screenshots from www.browsershots.org

Windows

MSIE 5.01
MSIE 5.01
Windows XP
MSIE 5.5
MSIE 5.5
Windows 2000
MSIE 6.0
MSIE 6.0
Windows 2000
MSIE 7.0
MSIE 7.0
Windows XP
MSIE 8.0
MSIE 8.0
Windows XP
Navigator 9.0.0.5
Navigator 9.0.0.5
Windows 2000
SeaMonkey 1.1.7
SeaMonkey 1.1.7
Windows XP
Firefox 1.5
Firefox 1.5
Windows 2000
Firefox 2.0.0.4
Firefox 2.0.0.4
Windows 2000
Firefox 3.0
Firefox 3.0
Windows XP
Flock 1.0.8
Flock 1.0.8
Windows 2000
Opera 9.26
Opera 9.26
Windows XP
K-Meleon 1.1.4
K-Meleon 1.1.4
Windows 2000
Safari 3.0
Safari 3.0
Windows XP
Chrome 0.2
Chrome 0.2
Windows XP

also tested Opera 7.23, 8.10, 9.23, 9.24, 9.25; Navigator 4.6, 4.75, 7.0, 8.0

Mac OS

Safari 1.3.2
Safari 1.3.2
Mac OS X 10.3
Safari 2.0.4
Safari 2.0.4
Mac OS X 10.4
Safari 3.0.4
Safari 3.0.4
Mac OS X 10.5
Firefox 2.0.0.6
Firefox 2.0.0.6
Mac OS X 10.4
Firefox 3.0
Firefox 3.0
Mac OS X 10.5

Linux

SeaMonkey 1.1.8
SeaMonkey 1.1.8
Ubuntu 8.04 LTS
Mozilla 1.7.8
Mozilla 1.7.8
Debian 3.1
Firefox 3.0
Firefox 3.0
Ubuntu 7.10
Konqueror 3.3
Konqueror 3.3
Debian 3.1
Konqueror 3.5
Konqueror 3.5
Ubuntu 6.06 LTS
Navigator 9.0.0.5
Navigator 9.0.0.5
Ubuntu 7.04
Opera 9.50
Opera 9.50
Ubuntu 7.10
Galeon 2.0.2
Galeon 2.0.2
Ubuntu 8.04 LTS
Epiphany 2.20
Epiphany 2.20
Ubuntu 7.10
Kazehakase 0.5.1
Kazehakase 0.5.1
PLD 3.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

BSD

SeaMonkey 1.1.7
SeaMonkey 1.1.7
FreeBSD 6.3
Opera 9.25
Opera 9.25
FreeBSD 6.3
Epiphany 2.20
Epiphany 2.20
FreeBSD 6.3
Galeon 2.0.4
Galeon 2.0.4
FreeBSD 6.3

YOU MAY USE THIS COMPAKT CODE OF addEvent, ...

... 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