标签:
先定义转义符,因为默认的转义符<%= %> 与jsp的冲突(如果js模板写在jsp页面中)
_.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g
};
<script type="text/template" id="detailedBar-template">
<div class=‘title‘>
<span class=‘label‘>本次消费</span>
<span class=‘numOfDinner‘>{{numOfDiner}}人用餐</span>
<span class=‘amount‘><span class=‘symbol‘>{{currencySymbol}}</span>{{amount}}</span>
</div>
</script>
Backbone 模板 underscore template默认的转义符<%= %> 与jsp的冲
标签:
原文地址:http://my.oschina.net/wallenheng/blog/423120