是否可以在同一个模板文件中执行此操作:
<script id="events_calendar_template" type="text/html">
{{#events}}
<h1>{{EventTitle}}</h1>
<h2>{{EventDate}}{{#ShowTimes}} - {{EventStartTime}} - {{EventEndTime}}{{/ShowTimes}}</h2>
<h3>{{CategoryName}}</h3>
<p>{{EventLongDescription}}</p>
{{/events}}
</script>
<div id="events_calendar_holder"></div>
渲染html:
var view = {events:events};
$("#events_calendar_holder").html($.mustache($("#events_calendar_template").html(), view)).hide().fadeIn('slow');