Skip to content

Instantly share code, notes, and snippets.

@brianpurkiss
Created October 29, 2020 15:54
Show Gist options
  • Save brianpurkiss/d15b6b3a344178de7dae39caf487f079 to your computer and use it in GitHub Desktop.
Save brianpurkiss/d15b6b3a344178de7dae39caf487f079 to your computer and use it in GitHub Desktop.
Defer inline javascript to after DOMContentLoaded
<script>
window.addEventListener('DOMContentLoaded', function() {
(function($) {
console.log('Hello world.');
})(jQuery);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment