Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Created June 23, 2015 10:35
Show Gist options
  • Save WebReflection/ba7d631bfd0fb5263e75 to your computer and use it in GitHub Desktop.
Save WebReflection/ba7d631bfd0fb5263e75 to your computer and use it in GitHub Desktop.
Inspired by jQuery, an inline function to solve forever any problem related to DOMContentLoaded (with or without defer)
!function(r,e,a,d,y){function $(f){d?f():r.push(f)}e.ready=$;e.addEventListener(a,y=function(){d=!e.removeEventListener(a,y,d);while(y=r.shift())y()},d)}([],document,'DOMContentLoaded',!1);
@WebReflection
Copy link
Author

for CSP

sha1-eBQ1Q8PXgJUyhZkfz74UbgIiXVU=
sha256-vH9D1F+qE1rzno3CTuRysTTkgXtjA5PN2SbMkBH4Z/I=

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