Created
June 13, 2021 14:17
-
-
Save blogjunkie/9a187bb5e30f6c9fa9c4c5e80de8caeb to your computer and use it in GitHub Desktop.
Mimic defer script for inline JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// Load only after DOMContentLoaded event | |
window.addEventListener('DOMContentLoaded', function() { | |
(function($) { | |
// do something | |
})(jQuery); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment