JsRender系列demo-10
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.js" type="text/javascript"></script>
<script src="../../jsrender.js" type="text/javascript"></script>
<link href="../resources/demos.css" rel="stylesheet" type="text/css" /> <link href="../resources/movielist.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a href="../demos.html">JsRender Demos</a><br /> <h3>Comparison tests</h3> <pre>
{{if !(languages && languages.length)}}...{{/if}} {{if languages==null}}...{{/if}}
</pre> <!--================ Demo ================--> <script id="movieTemplate" type="text/x-jsrender">
<tr>
<td>{{>title}}</td>
<td>
{{if !(languages && languages.length) tmpl="#messageTmpl"/}}
</td>
<td>
{{if languages==null tmpl="#messageTmpl"/}}
</td>
</tr>
</script> <script id="messageTmpl" type="text/x-jsrender">
<b>Warning:</b> <em>No alternate languages</em>
</script> <table>
<thead><tr><th>Title</th><th>{{if !(languages && languages.length)}}</th><th>{{if a==null}}</th></tr></thead>
<tbody id="movieList"></tbody>
</table> <script type="text/javascript">
var movies = [
{
title: "Meet Joe Black",
languages: null
},
{
title: "The Mighty",
languages: []
},
{
title: "Eyes Wide Shut",
languages: [
{ name: "French" },
{ name: "German" },
{ name: "Spanish" }
]
}
]; $( "#movieList" ).html(
$( "#movieTemplate" ).render( movies )
); </script> </body>
</html>
JsRender系列demo-10的更多相关文章
- JsRender系列demo(9)自定义函数
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- JsRender系列demo(7)compline
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery.j ...
- JsRender系列demo(6)-无名
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery.j ...
- JsRender系列demo(5) for else
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- JsRender系列demo(4)-if else
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- JsRender系列demo(3)-自定义容器
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- JsRender系列demo(2)多模板-template
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- JsRender系列demo(1)-insert-data
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- ABP(现代ASP.NET样板开发框架)系列之10、ABP领域层——实体
点这里进入ABP系列文章总目录 基于DDD的现代ASP.NET开发框架--ABP系列之10.ABP领域层——实体 ABP是“ASP.NET Boilerplate Project (ASP.NET样板 ...
- JVM基础系列第10讲:垃圾回收的几种类型
我们经常会听到许多垃圾回收的术语,例如:Minor GC.Major GC.Young GC.Old GC.Full GC.Stop-The-World 等.但这些 GC 术语到底指的是什么,它们之间 ...
随机推荐
- Bring up a website by wordpress
WORDPRESS WordPress is web software you can use to create a beautiful website or blog, which is both ...
- 使用CInternetSession CHttpFile下载网页链接地址的文件
思路很清晰,使用CInternetSession创建CHttpFile对象.然后对该对象获取文件信息.进行文件读写操作均可. void DownloadFile(LPCTSTR szURL, LPCT ...
- NavigationBar的简单设置
http://blog.csdn.net/hufeng825/article/details/7643532#) .Label属性设置 titleLabel = [[UILabel alloc] in ...
- Lucene 3.0
http://www.cnblogs.com/forfuture1978/archive/2010/02/22/1671487.html http://www.cnblogs.com/jiekzou/ ...
- Ajax入门小例子
大牛文章:http://www.cnblogs.com/guduoduo/p/3681296.html ---Ajax基础学习 http:/ ...
- ros-Qt代码环境的搭建
1 建立package catkin_create_pkg beginner_tutorials roscpp 2 导入Qt Qt中打开整个工作空间的src/CMakeLists.txt 在倒数第二行 ...
- openerp经典收藏 深入理解对象(转载)
深入理解对象(转载) 原文地址:http://shine-it.net/index.php/topic,2159.0.htmlhttp://blog.sina.com.cn/s/blog_57ded9 ...
- 简单的C#线程开发实例(隔一秒改变一下Label的Text)
要实现的效果:点击按纽,窗口上的label上出现1~100数字的变化. 第一个实例(把窗口上的label上文字改成0): using System; using System.Windows.Form ...
- 2016 系统设计第一期 (档案一)jQuery checkbox 取值赋值
<div class="form-group"> <label for="IsActive" class="col-sm-2 con ...
- POJ 1195 2维线段树(树套树实现) 树状数组
1: #include <stdio.h> 2: #include <string.h> 3: #include <stdlib.h> 4: #include &l ...