simple demo of Handlebars.js & jquery.js
2024-09-02 11:06:07
simple demo of Handlebars.js & jquery.js
<html>
<head>
<script src="jquery-1.11.0.min.js"></script>
<script src="handlebars-v1.3.0.js"></script>
</head>
<script>
$(document).ready(function() {
var source = $("#entry-template").html();
var template = Handlebars.compile(source);
var context = {title: "My New Post", body: "This is my first post!"}
var html = template(context);
$("body").html(html);
})
</script>
<body> </body>
<script id="entry-template" type="text/x-handlebars-template">
<div class="entry">
<h1>{{title}}</h1>
<div class="body">
{{body}}
</div>
</div>
</script>
</html>
最新文章
- No Entity Framework provider found for the ADO.NET provider with invariant
- c++字符串
- 在JAVA中,关于反射机制的讨论
- Code First06---CodeFirst中的一对多关系
- Xcode6与Xcode5中沙盒的变动以及偏好设置目录的变动
- Unity手游之路&;lt;七&;gt;角色控制器
- Eclipse图标含义
- struts2表单提交的乱码的问题的解决
- Linux指令--ping
- 解析PHP程序员需要掌握的必备技能
- Django ORM中,如何使用Count来关联对象的子集数量
- 开源虚拟化KVM(一)搭建部署与概述
- a标签总结
- RedHat如何关闭防火墙&#160;:&#160;http://blog.csdn.net/chongxin1/article/details/76072758
- iOS---代理、协议、通知 详解
- Java 注解实例
- Pycharm 激活码(转) 有效期到2019/10月
- SQLyog客户端无法连接MySQL服务器
- 虚拟机安装Ubuntu的上网设置(有线网络和无线网络)
- 大数据学习之Scala中main函数的分析以及基本规则(2)
热门文章
- 编译webrtc for android库与apk
- eclipse spring4 ehache2.10 整合
- Fragment 懒加载
- php部分--题目:投票 重点:两个div套用,显示百分比;
- 【spring配置】——spring整合Quartz定时器
- 九度OJ 1164:旋转矩阵 (矩阵运算)
- mysql系列之5.mysql备份恢复
- BCH分叉是一次站队博弈
- WordPress升级出现Briefly unavailable for scheduled maintenance. Check back in a minute.
- LeetCode——Binary Tree Postorder Traversal