解决方法
从
here开始:
Under the hood: $(document).ready() As you would expect from John
Resig,jQuery’s method for determining when the DOM is ready uses an
assortment of optimizations. For example,if a browser supports the
DOMContentLoaded event (as many non-IE browsers do),then it will fire
on that event. However,IE can’t safely fire until the document’s
readyState reaches “complete”,which is typically later. If none of
those optimizations are available,window.onload will trigger the
event.
这些事件独立于HTML标记内的位置,因为即使在呈现< / body>时,其他事件仍在进行中.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。