<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
 <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
  <link rel="stylesheet" href="../style/weui.css"/>
  <link rel="stylesheet" href="../style/weui2.css"/>
  <link rel="stylesheet" href="../style/weui3.css"/>
      <script src="../zepto.min.js"></script>
      <script>
  $(function(){

	  
	  });    
      
      </script>
</head>

<body ontouchstart style="background-color: #f8f8f8;">
<div id="content"></div>
<script>
var data={
    txt:"登鹳雀楼",
    list:[
        "白日依山尽",
        "黄河入海流",
        "欲群千里目",
        "更上一层楼"
    ]
}
var tplHTML=' <div class="weui_cells_title"><%=txt%></div>'+
        '<div class="weui_cells">'+
        '<% for(var i=0;i<list.length;i++){ %><div class="weui_cell">'+
                '<div class="weui_cell_bd weui_cell_primary">'+
                    '<p><%=list[i]%></p>'+
                '</div></div><% } %></div> ';
var dest=tpl(tplHTML,data);
$("#content").html(dest);
</script> 

<div id="content1"></div>
 <script id="tpl" type="text/html">
         <div class="weui_cells_title"><%=title%></div>
        <div class="weui_cells">
        
         <% for (var i = 0; i < list.length; i ++) {   %>
                    <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <p><%= i + 1 %> ：<%=list[i] %>
                    <%=this.title1||'不存在则输出'%>
                    <%= (this.t!=undefined)?"存在":"不存在"%>
                    </p>
                </div>
                
            </div>
<% } %>
   <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    <p>
                    <input class="weui_input" type="text" value="<%=tm%>">
                    <%=tm%>
                    </p>
                </div>
                
            </div>
</div>

</script>
<script>
var data1 = {
	title: '你最喜欢的电影是什么?',
	list: ['疯狂动物城', '肖申克的救赎', '星球大战', '拯救大兵瑞恩'],
	tm:"2016-12-01 12:45"
};
var tplx = document.getElementById('tpl').innerHTML;
var desc1=tpl(tplx,data1);
document.getElementById('content1').innerHTML = desc1;

</script>
</body>
</html>
