开发者

What is wrong with this page onload code?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜