Please see this jsFiddle. Note that the click event works just fine (try clicking anyw开发者_StackOverflow社区here in the output), but not the document load event.
The document requires DOMContentLoaded
.
_bl_event(document, 'DOMContentLoaded', d1, false);
_bl_event(document, 'DOMContentLoaded', d2, false);
...though it isn't supported in all browsers.
Example: http://jsfiddle.net/bCtQQ/15/
This has different meaning from placing a load
handler on window
.
Ach, I finally got it — attaching the event to window
instead of document
seems to work much better.
精彩评论