title: calling a javascript function in {{if}} of jquery template
body: <p>have a  javascript function as follows:</p>
  
  <pre><code>function test(item) {
         var DataToBeShownOnScreen = jQuery.data(document.body, "DataTobeShown");
         var found = $.inArray(item, DataToBeShownOnScreen) &gt; -1;
         return found;
  }
  </code></pre>
  
  <p>and I need to call this function in my jquery template as follows:</p>
  
  <pre><code>&lt;script id="GridTemplate" type="text/html"&gt;
       &lt;tbody&gt;            
           {{each Data}} 
               &lt;tr&gt;
                 {{each $value}} 
                 {{if ${test($index)} }}                   
                     &lt;td&gt;${$value}&lt;/td&gt;
                 {{/if}}
                 {{/each}}
               &lt;/tr&gt;
            {{/each}} 
       &lt;/tbody&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>But I am getting error:</p>
  
  <blockquote>
    <p>expected identifier, string or number</p>
  </blockquote>
  
  <p>I want help in understanding what is the mistake i am doing in the call of function test in the <code>{{if}}</code> of my template.</p>