title: When should I observe Javascript events on window vs. document vs. document.body?
body: <p>I'm using prototype.js for my web app, and I have everything running on Chrome, Safari, and Firefox.  I am now working on IE8 compatibility.</p>
  
  <p>As I've been debugging in IE, I've noticed that there are Javascript events for which I have previously set an observer on the window, e.g.</p>
  
  <pre><code>Event.observe(window, eventType, function () {...});
  </code></pre>
  
  <p>(where <code>eventType</code> might be <code>"dom:loaded"</code>, <code>"keypress"</code>, etc.) and it works just fine in Chrome/Safari/Firefox.  However, in IE the observer never fires.  </p>
  
  <p>In at least some cases I could get this to work on IE by instead placing the observer on something other than <code>window</code>, e.g.  <code>document</code> (in the case of <code>"dom:loaded"</code>) or <code>document.body</code> (in the case of <code>"keypress"</code>).  However, this is all trial-and-error.</p>
  
  <p>Is there some more systematic way to determine where to place these observers such that the results will be cross-browser compatible?</p>