-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
29 lines (29 loc) · 923 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
29
<!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')
window.xxx = function(e){
alert('打钱成功,再打一元,一统天下!')
amount.innerText = amount.innerText -1
delete window.xxx
}
script.src = '/pay?callbackName=xxx'
document.body.appendChild(script)
script.onerror = function(){
alert('打钱失败,重新打钱')
}
document.body.removeChild(script)
})
</script>
</body>
</html>