onLoad和DOMContentLoaded的区别

DOMContentLoaded

当纯 HTML 被完全加载以及解析时,DOMContentLoaded 事件会被触发,而不必等待样式表,图片或者子框架完成加载。

load

The load event is fired when the whole page has loaded, including all dependent resources such as stylesheets and images. This is in contrast to DOMContentLoaded, which is fired as soon as the page DOM has been loaded, without waiting for resources to finish loading.

文章作者: wenmu
文章链接: http://blog.wangpengpeng.site/2020/01/09/onLoad%E5%92%8CDOMContentLoaded%E7%9A%84%E5%8C%BA%E5%88%AB/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 温木的博客
微信打赏