简体   繁体   English

DOMContentLoaded事件何时确切触发?

[英]When exactly does the DOMContentLoaded event fire?

The docs say: 文档说:

The DOMContentLoaded event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. 当初始HTML文档已完全加载和解析时,无需等待样式表,图像和子帧完成加载,就会触发DOMContentLoaded事件。

But what does "loaded and parsed" mean? 但是“加载并解析”是什么意思? Does it mean that they've been painted on the screen? 这是否意味着它们已经在屏幕上绘制了?

According to the Living Standard it is 根据生活标准

Fired at the Document once the parser has finished 解析器完成后向文档触发

Which to me implies nothing has been drawn yet. 在我看来,这还算不上什么。 Just that it has loaded the content so it can render the content. 只是它已经加载了内容以便可以呈现内容。 Although note that is is from a "non-normative" section, which means it is not binding. 尽管注意这是来自“非规范”部分,这意味着它没有约束力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM