-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.html
More file actions
29 lines (28 loc) · 699 Bytes
/
test.html
File metadata and controls
29 lines (28 loc) · 699 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./test.js"></script>
</head>
<body>
<button id="btn">获取数据</button>
<script>
let p = new Promise((resolve, reject)=>{
setTimeout(function(){
resolve('ok')
},100)
})
const res = p.then(res=>{
// return 'p'
return new Promise((resolve, reject)=>{
reject('no')
})
},err=>{
console.log(err)
})
console.log(res)
</script>
</body>
</html>