<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="aDiv"></div>
<script id="test" type="text/html">
<h1>{{title}}:{{count}}:{{isAdmin?"a":"b"}}</h1>
<table>
{{each list as value index }}
<tr>
<td>{{index}}</td>
<td>{{value}}</td>
<td>{{aa(value)}}</td>
</tr>
{{/each}}
</table>
</script>
</body>
</html>
<script src="js/Jquery.js" type="text/javascript"></script>
<script src="js/template-simple.js" type="text/javascript"></script>
<script type="text/javascript">
var strAdd = function(str) {
return str+"dsajlk";
}
var data = {
title: '基本例子',
isAdmin: true,
count: "aaa",
list: ['文艺', '博客', '摄影', '电影', '民谣', '旅行', '吉他']
};
template.helper("aa", strAdd);
var html = template('test', data); //解析模板
$("#aDiv").html(html);
</script>
template.js模板
需积分: 4 181 浏览量
2022-12-07
13:26:54
上传
评论
收藏 39KB ZIP 举报
MeGoodtoo
- 粉丝: 36
- 资源: 33
最新资源
- 信息办公个人求职管理系统-jobgljsp.rar
- 信息办公一流网络JSP网络管理系统 v1.0-yljsp10.rar
- chirpstack学习
- 管家婆辉煌、财贸、工贸、服装,食品,千方模拟狗
- 基于python开发的工业环境老鼠检测+源码+文档(毕业设计&课程设计&项目开发)
- USB转以太网的芯片SR9900全套设计资料包括(参考设计原理图PCB+ Linux -Windows驱动程序+量产工具)
- 信息办公XML考试系统-xmlks.rar
- 基于python开发的无人机图像目标检测+实验数据+开发文档+操作流程+源码(毕业设计&课程设计&项目开发)
- 全球智能商品管理与优化系统
- IDM下载器(电脑小工具)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈