template读取数据json
来源:互联网 发布:红蜘蛛软件安装 编辑:程序博客网 时间:2024/06/08 11:17
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<title>中医体质</title>
<link rel="stylesheet" href="resources/css/public.css" />
<link rel="stylesheet" href="resources/css/health_ques.css" />
</head>
<body>
<header class="bar_nav">
<a class="step" href="javascript:">下一步 1/6</a>
<h2 class="title">健康问卷</h2>
</header>
<section class="pad_top62">
<form id="china">
<section class="h_total" id="questionShower">
<h3>中医体质</h3>
<!--<div class="form_group">
<label class="cell2_title">饮食偏向</label>
<ul class="cell3_choose">
<li>
<input type="radio" name="dietBlance" id="diet01" value="2" class="radio">
<label class="radio" for="diet01">荤素均衡</label>
</li>
<li>
<input type="radio" name="dietBlance" id="diet02" value="2" class="radio">
<label class="radio" for="diet02">荤食为主</label>
</li>
<li>
<input type="radio" name="dietBlance" id="diet03" value="2" class="radio">
<label class="radio" for="diet03">素食为主</label>
</li>
</ul>
</div>-->
</section>
</form>
</section>
<script type="text/javascript" src="resources/js/jquery-2.1.1.min.js" ></script>
<script type="text/javascript" src="resources/js/health_ques.js"></script>
<script type="text/javascript" src="resources/js/template.js"></script>
<script type="text/javascript">
$(function() {
chinaLoad();
});
function chinaLoad() {
var url = "resources/data/chiandatea.json";
$.get(url, function(data) {
if(data) {
console.log(data);
$("#questionShower").append(template("liTpl", data))
}
}, "json");
}
</script>
<script type="text/html" id="liTpl">
{{each arr as firstarr}}
{{each firstarr.questions as secondarr}}
{{if !secondarr.dispaly}}
<div class="form_group">
<label class="cell2_title">{{secondarr.question}}</label>
<ul class="cell3_choose">
{{each secondarr.answers as thindarr thirdindex }}
<li>
<input type="radio" name="{{secondarr.code}}" id="{{secondarr.code+thirdindex+1}}" value="{{thindarr.value}}" class="radio">
<label class="radio" for="{{secondarr.code+thirdindex+1}}">{{thindarr.name}}</label>
</li>
{{/each}}
</ul>
</div>
{{/if}}
{{/each}}
{{/each}}
</script>
</body>
</html>
阅读全文
1 0
- template读取数据json
- 使用jquery template绑定json数据
- struts2 读取json数据
- Grid读取json数据
- json数据读取
- Grid读取json数据
- js读取json数据
- 读取Json数据
- 读取json数据
- perl 读取json 数据
- js读取json数据
- js读取json数据
- json数据无法读取
- java读取json数据
- AJAX读取json数据
- AJAX读取json数据
- js读取json数据
- js读取json数据
- 脑壳清痛之---总结thinkphp5 怎么用odbc连接sql2000
- 嵌套双重c:forEach,下拉框显示时重复
- 快速上手MySql && MySql GUI工具 SQLyog Community (5)
- Bootstrap 3.3.7学习笔记5
- JavaScript判断用户是通过电脑端还是移动端访问;js浏览器判断navigator
- template读取数据json
- 支付宝“刷脸支付”韩国遇冷 真相让人笑出眼泪
- WIN7免安装配置mysql5.7.18
- 将 Windows 的 thinkPHP 项目上传至 Linux 服务器遇到的问题及解决方法
- fastJson——使用,过滤,多级过滤
- 欢迎使用CSDN-markdown编辑器
- 剑指offer-02-将一个字符串中的空格替换成“%20”
- 欢迎使用CSDN-markdown编辑器
- Letcode 98 Validate Binary Search Tree