-
Notifications
You must be signed in to change notification settings - Fork 0
/
window_load.html
62 lines (57 loc) · 1.63 KB
/
window_load.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
62
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>蚂蚁部落</title>
<style type="text/css">
#bg {
width: 100px;
height: 100px;
border: 2px solid red;
background: red;
}
</style>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
window.onload = function() {
document.getElementById("bg").style.backgroundColor = "#F90";
};
function confirm_delete() {
return confirm('are you sure?');
};
$('.deleteObject').click(function() {
var url = this.href;
var confirmText = "Are you sure you want to delete this object?";
if (confirm(confirmText)) {
// $.ajax({
// type: "POST",
// url: url,
// success: function() {
// // Here goes something...
// },
// });
alert("Action to delete");
}
return false;
});
function img_confirm_delete(question) {
if (confirm(question)) {
alert("Action to delete");
} else {
return false;
}
}
</script>
</head>
<body>
<div id="bg"></div>
<a href="#" onclick="return confirm('are you sure?')">我是一个弹窗</a>
<hr>
<a href="#" onclick="return confirm_delete()">我是另外一个弹窗</a>
<hr>
<a href="#" class="deleteObject">这是一个错误的方法.</a> <!-- 完全没作用. -->
<hr>
<img src="images/WechatIMG396.png" height="20" width="20" onclick="return img_confirm_delete('Are you sure?')">
</body>
</html>