I'm working on Addy Osmani's Backbone Fundamentals tutorial. http://addyosmani.github.io/backbone-fundamentals/#application-view
and am getting an "Uncaught SyntaxError: Unexpected token % " in Chrome.
It's pointing to a line in Underscore.js and also a line in my views/app.js.
In views/app.js, the line it's pointing to is:
statsTemplate: _.template( $('#stats-template').html() ),
It says "anonymous function" in the error message. This was copied from the tutorial, so I'm not sure why it's throwing an error. Thanks
Template markup:
<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>
$('#stats-template').html()contain? Looks like a syntax error in there. - Bergistats-templatemarkup -- please post. - McGarnagle<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>- gh0st