-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathres.html
More file actions
50 lines (40 loc) · 1.57 KB
/
res.html
File metadata and controls
50 lines (40 loc) · 1.57 KB
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="ResourceLoader.js"></script>
</head>
<body>
<div id="log"></div>
<script type="text/javascript">
var rl = new ResourceLoader();
rl.onload = function(r){
document.getElementById('log').innerHTML += '<p>done</p>';
console.log('done');
}
rl.onloading = function(c, t){
document.getElementById('log').innerHTML += '<p>' + c + '/' + t + ' [' + Math.floor(c / t * 100) + '%]' + '</p>';
console.log(c, t);
}
rl.onerror = function(name, url){
document.getElementById('log').innerHTML += '<p>ERROR : Resource load failed. ['
+ name + ' : ' + url + ']</p>';
console.log('ERROR : Resource load failed. [' + name + ' : ' + url + ']');
}
rl.load({
'baidu' : 'http://www.baidu.com/img/baidu_sylogo1.gif',
'test1' : 'https://www.google.com.hk/logos/2012/klimt12-sr.png',
'test2' : 'http://img.xptheme.com.cn/allimg/090425/0242560.jpg',
'test3' : 'http://www.guilin98.com/upfile/route/2006/07/10/d9414183690.jpg',
'test4' : 'http://img2.fengniao.com/product/19/649/ceQ4nfaPUF8Wg.jpg',
'test5' : 'http://www.djy.gov.cn/upload/20090116_110316_136.jpg',
'test6' : 'http://img.ivsky.com/Photo/UploadFiles/2010-6/201063113215692.jpg',
'test7' : 'http://img.wallpapersking.com/d5/0/3/2006110909330234382.jpg',
'test8' : 'http://img.ivsky.com/img/bizhi/img/201009/04/xinjiang-028.jpg',
'test9' : 'http://www.51766.com/img/shlycsgn/1322706429715.jpg',
'test10' : 'http://pic2.nipic.com/20090408/2137336_070710069_2.jpg',
'test11' : 'http://photo.aiutrip.com/pic/2009-11-14/155810162.jpg'
})
</script>
</body>
</html>