Javascript – The module / DOMContentLoaded event conundrum
I used to have a js script which is imported in html as type text/javascript. Let's call it main.js I used a DOMContentLoaded event listener, so that as the page was loaded, we would run the script. Now I need…