What is the difference between document load event and document DOMContentLoaded event?

Technology CommunityCategory: JavaScriptWhat is the difference between document load event and document DOMContentLoaded event?
VietMX Staff asked 3 years ago
  • 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.
  • window‘s load event is only fired after the DOM and all dependent resources and assets have loaded.