-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (51 loc) · 1.06 KB
/
index.html
File metadata and controls
54 lines (51 loc) · 1.06 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<link rel="stylesheet" href="css/bootstrap.css" />
<body>
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
</thead>
<tbody id="tbody">
<tr id="tableInfo">
</tr>
</tbody>
</table>
</body>
<script src="js/jquery.js"></script>
<script>
function ajax() {
$.ajax({
type: "post",
url: "http://localhost:12345/seek",
data: {
name: "laoxie",
skill: "PS",
age: 18
},
dataType:"json",
async: true,
success: function(data) {
console.log(data)
$.each(data.news, function(i, d) {
console.log(i)
//$('#tableInfo').css('display', 'inline');
//记得隐藏第一个li
$('#tbody').html('<tr><th scope="row">'+i+'</th><td>'+d.title+'</td><td>Otto</td><td>@mdo</td>d.title</tr>').appendTo('#tbody');
})
//$('#ul2>li:first').css('display', 'none');
}
});
}
ajax()
</script>
</html>