Here's what's going on:

  1. defer.js is included in the head with a defer attribute. Meaning it shouldn't execute in IE until the DOM is usable. The code in defer.js runs inside a YAHOO.util.onDOMReady function which means it shouldn't execute in an A-Grade browser until the DOM is usable.
  2. An inline script is included in the body.
  3. Both script blocks log "interesting events" - check the logger to see when events fire (and try this with an empty and a primed cache).

This appears to avoid the situation where Internet Explorer incorrectly fires YAHOO.util.onDOMReady before the DOM is actually usable.