First, this is not a duplicate of this question... And you'll see why in a second.
I have a file that I want to reference in my HTML
<script src="dist/js/script.js"></script>
But I want to check if it was loaded or not and when it loads I want to do something with it...
I have tried using the load
event(addEventListener
) but for some reason (I think because I have async
features in the external file) it doesn't work.
I'm using an inline script
tag after the external file and this (inline script
) block of code gets executed before the script tag above it (The external file), and I want the external file to load first before my inline script
How can I make it so that the inline <script>
runs after my external file has been 100% loaded?
window.onload
?backend