使用
$('#contactTemplate').render({name:'haiker', phone:'136'}).appendTo('#tpl');
语法
<script id="template" type="text/html">
<div>
Name:{{=name}}<br/>
{{if phones.length}}
Phone Nubmers;
<ul>
{{each(i,phone) phones}}
<li>{{=phone}}</li>
{{/each}}
</ul>
{{/if}}
</div>
</script>