-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path辛巴.html
61 lines (50 loc) · 1.31 KB
/
辛巴.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
<script>
var a=Symbol('a')
var b=Symbol('a')
console.log(a === b);
function timeout(ms) {
return new Promise((resolve, reject) => {
setTimeout(resolve, ms, 'done');
});
}
timeout(100).then((value) => {
console.log(value);
});
function loadimg() {
var img=new Image();
img.onload=function () {
console.log('我日');
};
img.onerror=function () {
console.log('我日1');
};
img.src='http://img.zcool.cn/community/[email protected]' ;
}
loadimg();
function loadImageAsync(url) {
return new Promise(function(resolve, reject) {
const image = new Image();
image.onload = function() {
resolve(image);
};
image.onerror = function() {
reject(new Error('Could not load image at ' + url));
};
image.src = url;
});
}
loadImageAsync('http://img.zcool.cn/community/[email protected]' ).then(function (a) {
console.log(a);
},function (e) {
console.log(e);
})
</script>