在我的应用程序中,我试图用if
部分检查2个条件。但不工作。我没有得到的结果太..下划线模板 - 如何检查多个条件
这里是我的病情,我用什么:
<% _.each(recourseParameter, function (item, index) { %>
<% if (index % limit == 0) { %>
<%= _.template($('#header').html())({"parameterCode":parameterCode}) %>
<% } %>
<% if(item.description) { %>
<tr>
<td colspan=5><%= item.description %></td>
</tr>
<% } %>
<% if (((index+1) % limit == 0) && ((index +1) != limit)) { %> // this is not working!
<%= _.template($('#closer').html())() %>
<span>Continue ... </span> //this is not printing..
</div>
<% } %>
<% }) %>
你介意检查什么是在控制台日志中的错误?我得到这个错误:无法加载资源:net :: ERR_TUNNEL_CONNECTION_FAILED https://dl.dropboxusercontent.com/u/6257603/recourseParameter.json 错误:错误,但它可能是网络在这里无法连接到保管箱。我会在家里再试一次。在你身边可以吗? – Hatjhie 2014-09-29 05:50:22
这对我来说工作得很好。可能是这个URL被禁止给你。如果你希望让我给你基于静态数据的例子? – 3gwebtrain 2014-09-29 06:16:18
@Hatjhie - 这里是放置在小提琴演示中的数据:http://jsfiddle.net/ffk5raqL/4/ – 3gwebtrain 2014-09-29 06:20:37