-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusage.html
64 lines (55 loc) · 1.59 KB
/
usage.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>js loader</title>
<script src="xflibloader.js"></script>
<script>
function xfoutput(data){
var output = document.getElementById('output');
output.innerHTML += data + '<br/>';
}
/*
XFLibLoader.load({
libs: ['js/jquery.js', 'lhgdialog/lhgdialog.js'],
order: true,
loaded: function () {
}
});
*/
function ready(){
xfoutput('<b>[1] load finish.js directly</b>');
XFLibLoader.load('demo/js/finished-param-string.js');
xfoutput('<b>[2] load finished.js without specifing host, reporting loaded event.</b>');
XFLibLoader.load({file:'demo/js/finished-param-object.js', loaded:function(){
xfoutput('<i>finished-param-object.js loaded event</i>');
}});
xfoutput('<b>[3] load (1-3).js without specifing host, reporting every resource\'s loaded event.</b>');
XFLibLoader.load([
{file:'demo/js/1.js', loaded:function(){
xfoutput('<i>1.js loaded event</i>');
}},
{file:'demo/js/2.js', loaded:function(){
xfoutput('<i>2.js loaded event</i>');
}},
{file:'demo/js/3.js', loaded:function(){
xfoutput('<i>3.js loaded event</i>');
}}
]);
xfoutput('<b>after (1-5).js loaded orderly in directory "demo/js/", finished.js should be loaded also.</b>');
XFLibLoader.load({
host: 'demo/js',
libs: ['1.js', '2.js', '3.js', '4.js', '5.js'],
order: true,
loaded: function () {
XFLibLoader.load('finished.js');
}
}
);
}
</script>
</head>
<body onload="ready()">
<div id="output" style="margin: 100px;"></div>
</body>
</html>