I have an weebsite (Cordova/Phonegap app actually) that currently has in <head>
:
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="appPolyfills.js"></script>
<script type="text/javascript" src="appLibs.js"></script>
<script type="text/javascript" src="app.js"></script>
This works fine, but actually the website scripts are quite heavy, so while the scripts are parsed, the html of the page is actually not displayed.
I want the HTML of the page to be displayed, and only then load the scripts above.
I know I can load the scripts in the <body>
tag, but in my case I must absolutly load these scripts sequentially.
So basically what I want is:
- Make the HTML display immediately on startup before loading any script
- Load the scripts sequentially in body
- Be notified when the last script (app.js) is loaded, so that I can start the app (as the document ready event has already fired, I need another one)
Is this possible?
I can accept a JQuery based solution but prefer raw javascript.