-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (28 loc) · 701 Bytes
/
index.js
File metadata and controls
34 lines (28 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"use strict";
// Load scripts[] one after the other in the specified order.
// Call fn after the last script is loaded.
//
function loadScripts ( scripts, fn )
{
function next ( ) {
let src = scripts.shift();
if ( src !== undefined ) {
// console.log("Load "+src);
let script = document.createElement("script");
script.src = src ;
script.onload = next ;
document.head.appendChild(script);
}
else
if ( fn ) fn();
}
next();
};
// Load all application scripts.
// Start application after the last script is loaded.
//
window.addEventListener("load", function() {
loadScripts(["Menu.js",
"console.js",
"main.js"]);
} );