Skip to content

Instantly share code, notes, and snippets.

@julianfrank
Created August 30, 2019 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julianfrank/a2241d293cfe5988e04a11110c3b5116 to your computer and use it in GitHub Desktop.
Save julianfrank/a2241d293cfe5988e04a11110c3b5116 to your computer and use it in GitHub Desktop.
js document load events capture

document.addEventListener("DOMContentLoaded", theDomHasLoaded, false); window.addEventListener("load", pageFullyLoaded, false);

function theDomHasLoaded(e) { // do something }

function pageFullyLoaded(e) { // do something again }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment