// somebody set up us the bomb - all your base2 window objects are
belong to us
base2.DOM.EventTarget(window);
// works
window.addEventListener("load", myInit, false);
// doesn't work
window.addEventListener("DOMContentLoaded", myInit, false);
Obviously when I say "doesn't work", it works in assorted Geckos,
Safari and Opera. I mean it doesn't work in IE (6 or 7)
So, just how is one supposed to actually make use of the support that
Base2 provides for DOMContentLoaded?
The window object is not part of the DOM. Use this instead:
document.addEventListener("DOMContentLoaded", myInit, false);
-dean
Ah right. And now I've tracked down my incorrectly overlapping script
tags, it works lovely.
However, just before moving on...
The standards-based way of doing this (in so far as DOMContentLoaded
is a standard?) is to do
window.addEventListener("DOMContentLoaded", myInit, false);
(or am I wrong? if so, please discount the following)
This will need flagging up in the docs. Or perhaps the code could
make a special exception if the element passed is the window object
and the handler is DOMContentLoaded, flipping the element that the
handler is set on to document? Just a thought.
Show me the standard for this.
-dean
Colour me nine shades of wrong.
Obviously, DOMCOntentLoaded is not actually a standard. What I meant,
was that I thought that Gecko (and Opera) required the handler to be
attached to the window object. I now realise, post actually bothering
to test it, that my supposition was tosh, and that using document
works just as well.