-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (32 loc) · 832 Bytes
/
index.html
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
35
36
37
38
39
40
41
42
43
44
45
<!-- Jquery 2.2.4 -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script>
function main() {
hi("Tracey");
}
//options
//list of urls to the file
var urls = ["https://www.jeffkmeng.com/js/hi.js"];
//wether to cache the script or not
var cache = false;
var lastIlteration = false;
for (i = 0; i < urls.length; i ++) {
if (i == urls.length - 1) {
lastIlteration = true;
}
$.ajax({
url: urls[i],
dataType: "script",
cache: cache
}).done(function(script, textStatus) {
//success
if (lastIlteration) {
main();
}
})
.fail(function(jqxhr, settings, exception) {
//error
console.log("Failed to load script.");
});
}
</script>