-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
51 lines (46 loc) · 1.32 KB
/
Copy pathindex.html
File metadata and controls
51 lines (46 loc) · 1.32 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
</head>
<body>
<div class="result"></div>
<script type="text/javascript">
$.getJSON("http://localhost:8087/demo/all").then(function(data)
{console.log(data);
var tr = data
for (var i = 0; i < data.length; i++) {
var tr = $('<tr/>');
// Indexing into data.report for each td element
$(tr).append("<td>" + data[i].id + "</td>");
$(tr).append("<td> " + data[i].name + "</td>");
$(tr).append("<td>       " + data[i].email + "</td>");
$('.table1').append(tr);
}
});
$.get( "http://localhost:8087/demo/ip", function( data ) {
$( ".result" ).html( "IP: " +data );
});
$.getJSON('http://localhost:8087/demo/all').done(function(data) {
console.log(data)
})
</script>
<table class="table1">
<tr>
<th>id</th>
<th>name</th>
<th>email</th>
</tr>
</table>
</body>
</html>
<form action="http://localhost:8087/demo/add" method="get">
name: <input type="text" name="name"><br>
email: <input type="text" name="email"><br>
<input type="submit" value="Add">
</form>