出于某种原因,这段代码在第 5 行抛出了一个语法错误。我在这里遗漏了什么?请帮忙!
<script type="text/template" id="question-template">
<h1 class="headline"><%= title %></h1>
<h2 class="subheadline"><%= question %></h2>
<ul class="answers">
<% _.each( answers, function( answer ) { %>
<% if (answer.type == "input") { %>
<li>
<input type="number" placeholder="<%= answer.title %>">
</li>
<% }else{ %>
<li><a class="answer" href="#question/<%= id+1 %>" <% if (typeof(answer.callback) !== "undefined") { %>onclick="<%= answer.callback %>"<% } %>>
<%= answer.title %></a>
</li>
<% } %>
<% }); %>
</ul>
</script>