-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
28 lines (28 loc) · 882 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<p> 我,秦始皇,打钱。你的余额为<span id="amount">&&&amount&&&</span> </p>
<input type="submit" value="付款一元" id="button">
<script>
button.addEventListener('click', function(){
let script = document.createElement('script')
script.src = '/pay'
document.body.appendChild(script)
script.onload = function(){
alert('打钱成功,再打一元,一统天下!')
amount.innerText = amount.innerText -1
}
script.onerror = function(){
alert('打钱失败,重新打钱')
}
document.body.removeChild(script)
})
</script>
</body>
</html>