javascript - Underscore template issue - Uncaught SyntaxError: Unexpected token < -


i'm getting above error when try load 1 of underscore templates. i'm guessing sort of issue in loop (which should -.each don't quite structure of yet).

my template

    <script type="text/html" id="customer-list-view">     <p> please click on customer select </p>         <table >             <thead>                 <th> customer name </th><th>last invoice date</th><th>last item added</th>             </thead>              <tbody>                 <% (var = 0, < customers.length, i++){ %>                     <tr class="custablerow"  id="<%=customers[i].objectid %>" >                         <td> <%= customers[i].custname %> </td>                         <td> <%= customers[i].custlastinvoicedate %> </td>                         <td> <%= customers[i].custlastitemdate %> </td>                     </tr>                  <% }; %>             </tbody>         </table>         <button id="customeradd"> add new customer </button>      <p> here should set of buttons working customers </p>  </script> 

and been called following

$('#tablediv').html(_.template($("#customer-list-view").html(), {'customers': globalcustomerlist})); 

i'm sure simple first table in template , can't see problem.

any receieved

you're using commas instead of semicolons in for.

<% (var = 0, < customers.length, i++){ %> 

should be

<% (var = 0; < customers.length; i++){ %> 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -