I have an XHTML page in which I have included several inline script tags. I have also included external third party js files into the page. I want a particular external/internal script to load before all other scripts included on the page. I have searched for the answer but all I got was how to load an external javascript after page load. However my intention is to load an external/internal script before all other scripts on the page. All my internal and external scripts are defined inside the head tag.
Asked
Active
Viewed 981 times
0
-
3scripts load in DOM order, so if you want something to load first, put it before everything else. – Brian Driscoll Mar 18 '14 at 13:40
-
1place the script in question first, that way it will load before the others. – agconti Mar 18 '14 at 13:40
-
possible duplicate of [load and execute order of scripts](http://stackoverflow.com/questions/8996852/load-and-execute-order-of-scripts) – Bergi Mar 18 '14 at 14:04
1 Answers
1
Scripts load in DOM order, so if you want something to load first, put it before everything else.
Place the script in question first, that way it will load before the others.

Doug S
- 10,146
- 3
- 40
- 45