DOMContentLoaded事件和load事件有什么区别?
DOMContentLoaded
load
From the Mozilla Developer Center :
(从Mozilla开发人员中心 :)
The DOMContentLoaded event is fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading (the load event can be used to detect a fully-loaded page).(当文档已完全加载和解析时,将触发DOMContentLoaded事件,而无需等待样式表,图像和子帧完成加载(可以使用load事件来检测完全加载的页面)。)
The DOMContentLoaded event is fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading (the load event can be used to detect a fully-loaded page).
(当文档已完全加载和解析时,将触发DOMContentLoaded事件,而无需等待样式表,图像和子帧完成加载(可以使用load事件来检测完全加载的页面)。)
2.1m questions
2.1m answers
60 comments
57.0k users