Html页面Javascript初始化页面的dom的创建顺序。

本文探讨了JavaScript中window.onload与document.ready的区别。document.ready在HTML文档加载完毕后触发,而window.onload则需等待包括图片在内的所有内容加载完成。文章进一步解释了这两种事件触发机制的特点及应用场景。

Html页面Javascript初始化页面的dom的创建顺序。

What is the difference between window.onload and document.ready ?

The ready event occurs after the HTML document has been loaded, while the onload event occurs later, when all content (e.g. images) also has been loaded.

The onload event is a standard event in the DOM, while the ready event is specific to jQuery. The purpose of the ready event is that it should occur as early as possible after the document has loaded, so that code that adds funcionality to the elements in the page doesn't have to wait for all content to load.

具体就太长了可以参考

http://www.w3.org/TR/2011/WD-html5-20110405/parsing.html

http://www.w3.org/TR/2011/WD-html5-20110405/tokenization.html

转载于:https://my.oschina.net/u/138995/blog/193897

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值