Martijn Martijn - 7 months ago 30
Javascript Question

Is it possible to wait until all javascript files are loaded before executing javascript code?

We have several JavaScript files which we load at the bottom of the master page. However, I have the situation that I need to perform some JavaScript before the other scripts are loaded. Is it possible to wait till all the JavaScript files are loaded and then execute some JavaScript code?

I thought

did this, but as it turns out, it doesn't. Of course we can move the script files from the bottom to the top, but I am wondering if it's possible what I want.


You can use


Which will wait until the page is loaded. $(document).ready() waits until the DOM is loaded