-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetail.html
More file actions
34 lines (32 loc) · 1002 Bytes
/
detail.html
File metadata and controls
34 lines (32 loc) · 1002 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<title>Title</title>
<script src="js/lib/zepto.min.js"></script>
<script src="js/lib/zepto.bindJSON.js"></script>
<style>
.red {
color: red;
}
.jsTemplate {
display: none;
}
</style>
</head>
<body>
<!--先给容器添加jsTemplate样式,这样数据没加载时容器是隐藏的,不会直接出现不友好的花括号和字段名-->
<section id="list" class="jsTemplate" data-jsonUrl="js/json/detail.json">
<div class="hd">{placeName}</div>
<div class="bd">活动时间:{activitytime}</div>
</section>
<script>
$("[data-jsonUrl]").bindJSON("detail", {},
//回调函数,数据加载完成后,显示容器。
function () {
$("#list").removeClass("jsTemplate");
});
</script>
</body>
</html>