网上提供的方法用不了
自己琢磨的
注意:ajax的异步方式必须设置成true才行,false不起作用。async: true;
<script> function timestamp (value) { var date = new Date(value); var y = date.getFullYear(); var m = date.getMonth() + 1; m = m < 10 ? ('0' + m) : m; var d = date.getDate(); d = d < 10 ? ('0' + d) : d; return y + '/' + m + '/' + d; } </script>
<script src="template-web.js"></script> <script id="muban" type="text/html"> <div> {{each list as value i}}
<span>{{value.id}}</span><br/>
<span>{{value.name}}</span><br/>
<span>{{value.time|timestamp}}</span>
{{/each}}
</div>
<script>