-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
91 lines (75 loc) · 2.37 KB
/
index.php
File metadata and controls
91 lines (75 loc) · 2.37 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<html>
<head>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="jquery/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<style>
.text-center {
text-align:center;
}
</style>
<script>
$(function(){
var dataresponse;
$.ajax({
url : "https://angelhack-sao-paulo.mybluemix.net/api/message",
method : 'GET',
dataType : 'json',
success : function(response) {
console.log(response);
dataresponse = response;
}
}).done(function(data) {
dataresponse = dataresponse.message;
dataresponse.map(function(response) {
var tbody = "<tr>"
+ "<td>"
+ field(response.id)
+ "</td>"
+ "<td>"
+ field(response.user)
+ "</td>"
+ "<td>"
+ field(response.message)
+ "</td></tr>";
$("#tbmessages > tbody").append(tbody);
});
});
})
</script>
</head>
<body>
xxx
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading text-center">
<h3>Mensagens</h3>
</div>
</div>
<div class="panel panel-body">
<div class="row">
<div class="col-xs-12">
<table class="table table-bordered table-horvered table-striped" id="tbmessages">
<thead>
<tr>
<th>id</th>
<th>user</th>
<th>message</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>