我正在研究Addy的骨干基础教程。http://addyosmani.github.io/backbone-fundamentals/#application-view
在Chrome中,我得到了一个"Uncaught :意外令牌%“。
它指向Underscore.js中的一行,以及视图/app.js中的一行。
在视图/app.js中,它指向的行是:
statsTemplate: _.template( $('#stats-template').html() ),它在错误消息中写着“匿名函数”。这是从教程中复制的,所以我不知道为什么要抛出一个错误。谢谢
模板标记:
<script type="text/template" id="stats-template">
<span id="todo-count">
<strong>
<%= remaining %>
</strong>
<%= remaining === 1 ? 'item':'items'%> left
</span>
<ul id="filters">
<li>
<a class="selected" href="#/">All</a>
</li>
<li>
<a href="#/active">Active</a>
</li>
<li>
<a href="#/completed">Completed</a>
</li>
</ul>
<% if(completed) {% >
<button id="clear-completed">Clear completed (<%= completed %>)</button>
<% } %>
</script>发布于 2013-07-19 22:43:11
https://stackoverflow.com/questions/17756361
复制相似问题