title: For loop in 'mustached' underscore template in jsp
body: <p>I am using underscore with backbone in a jsp app.</p>
  
  <p>In order to do that, I have used:</p>
  
  <pre><code>_.templateSettings = {
          interpolate : /\{\{(.+?)\}\}/g
      };
  </code></pre>
  
  <p>in order to have mustache-like templates so as to avoid jsp conflict.</p>
  
  <p>Until this point everything is ok (i.e. filled correctly templates with simple values).</p>
  
  <p>Now, I am trying to add a for loop inside the template in order to show a json array.</p>
  
  <p>So I added this code:</p>
  
  <pre><code>&lt;script type="text/template" id="im-template"&gt;
  &lt;div class="row"&gt;                                       
      &lt;div class="horizontal-scroll"&gt;
          {{ for (var i = 0; i &lt; data.length; i++) { 
              var template = data[i];
              alert(template.name);
          } }}
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>But when running the app, I get:</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token for 
  </code></pre>
  
  <p>Do you know what could be the problem or how could I solve it?</p>
  
  <p>Thanks in advance!</p>