使用template (模板引擎写的demo)
来源:互联网 发布:考研英语网络课程 编辑:程序博客网 时间:2024/05/20 09:08
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>template</title>
<style>
*{
margin: 0;
padding: 0;
list-style: none;
}
.box{
margin: 0 auto;
width: 800px;
}
.box>ul>li{
width: 80px;
height: 40px;
background-color: pink;
float: left;
margin-left: 10px;
}
</style>
</head>
<body>
<div class="box" id="box">
<ul>
<li>天气</li>
</ul>
</div>
</body>
<script src="./js/template-native.js"></script>
<script type="text/template" id="tem">
<% for(var i=0;i<list.length;i++){ %>
<ul>
<li><%=list[i]%></li>
</ul>
<% } %>
</script>
<script>
var data={
list:["天气","正好","下雨","阴天"]
};
var box=document.getElementById("box");
var html=template('tem',data)
box.innerHTML=html
</script>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>template</title>
<style>
*{
margin: 0;
padding: 0;
list-style: none;
}
.box{
margin: 0 auto;
width: 800px;
}
.box>ul>li{
width: 80px;
height: 40px;
background-color: pink;
float: left;
margin-left: 10px;
}
</style>
</head>
<body>
<div class="box" id="box">
<ul>
<li>天气</li>
</ul>
</div>
</body>
<script src="./js/template-native.js"></script>
<script type="text/template" id="tem">
<% for(var i=0;i<list.length;i++){ %>
<ul>
<li><%=list[i]%></li>
</ul>
<% } %>
</script>
<script>
var data={
list:["天气","正好","下雨","阴天"]
};
var box=document.getElementById("box");
var html=template('tem',data)
box.innerHTML=html
</script>
</html>
阅读全文
0 0
- 使用template (模板引擎写的demo)
- 高性能art-template模板引擎的使用
- 尝试使用google-template模板引擎
- template.js前端模板引擎使用
- javascript模板引擎template.render使用
- JavaScript模板引擎Template.js使用详解
- template.js前端模板引擎使用
- JavaScript模板引擎Template.js使用详解
- javascript模板引擎template.render使用
- Velocity基于java的模板引擎(template engine)
- C++template(模板)的使用
- Velocity模板引擎(template engine)
- 模板引擎Template
- art-template 模板引擎
- 类模板template的使用!
- c++模板 template的使用
- template模版引擎的使用(underscore.js)
- javascript中的模板引擎template
- 字符串String的 简单处理
- java中的内部类创建对象方法
- step by step
- android 文件目录权限
- 从K近邻算法、距离度量谈到KD树、SIFT+BBF算法
- 使用template (模板引擎写的demo)
- 基于BaseHTTPServer写的代理Post方法源码(只做参考,性能待优化)
- 第二章 js输出、语句、变量、注释
- 自定义Toast实现各种炫酷效果
- 在unity3d中接受MQTT消息协议数据C# .net,M2Mqtt
- iOS cell与cell.contentView的区别
- geometry-api-java 学习笔记(三)多点 multipoint
- qt线程
- lua判断点在任意多边形内部