_underscore loop in a template

id125

New Member
I keep getting an error with this. I keep getting a syntax error:\[quote\] syntax error var _p=[],print=function(){_p.push.a... ');}return __p.join('');\[/quote\]\[code\] <script id="product" type="text/template"> <p><span>items</span><span class='items'><%= _.each(info.items, function(books) { %> <%= books.name + ",&nbsp" %> <% }); %></span></p> </script>\[/code\]Anyone know why this error is happening. I have looked at some other people using this style and it seems correct but maybe I'm missing a symbol?Note: Fixed the issue. my code had a = sign in the wrong place.<%= _.each(info.items, function(books) { %>should be:<% _.each(info.items, function(books) { %>Not sure why you need the = for some areas and not for others. Maybe someone can explain.example in this area of the code I need to use a = sign : <%= books.name + ",&nbsp" %>
 
Top