0
我试图在HTML中将变量设置为if
。问题是我看不到我的模板,并且没有日志中的任何错误。我可以看到元素在HTML中,但仍然看不到它。无法看到模板
模板是:
<div class="list-group">
<div id="table_template">
<div id ="table"></div>
<script type="text/template" id="nextPage">
<% if (nextLink != "") { %>
<nav><ul class="pager"><li><a href="#" id="next_page" >Next</a></li> </ul> </nav>
<%}%>
</script>
</div>
</div>
</div>
和视图:
var template = _.template($('#nextPage').html());
view.$el.find('#nextPage').html(template(listSongs));
更新:看来我无法看到它,如果我有script标签。