-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.html
51 lines (41 loc) · 1.19 KB
/
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
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</title>
</head>
<body>
<div style="margin: auto auto">
</div>
<script src="jquery.min.js"></script>
<script>
$.ajax({
type: "POST",
url: "http://47.110.136.62:9501/api/community/hot",
dataType:"json",
data: {
},
success:function(respond){
if (respond){
var data = respond['result']['data'];
var html;
for (var item in data){
html+="<p>"+data[item]['title']+"</p>"+
"<p>"+data[item]['content']+"</p>";
for (var k in data[item]['uriLink']){
if (data[item]['article']<3){
html+="<p><img src='"+data[item]['uriLink'][k]+"'/></p>";
} else{
html+="<p><video src='"+data[item]['uriLink'][k]+"' autoplay controls></video></p>";
}
}
}
$("div").append(html);
}
},
error:function(error){
}
});
</script>
</body>
</html>