title: Call JavaScript function from JsRender
body: <p>I have a JsRender template. When template is rendering I want to call a JavaScript function to manipulate some data.</p>
  
  <p>Here is my JsRender template.</p>
  
  <pre><code>&lt;tr class="template-download"&gt;
     &lt;td class="size"&gt;
          &lt;span&gt;{{:size}}&lt;/span&gt;
     &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Now I want to pass <code>:size</code> value to JavaScript function and get the return value. So I can show return value instead of <code>:size</code> value.</p>
  
  <p>My JavaScript function is </p>
  
  <pre><code>function getSize(size) {
      var megabytes = size / (1024 * 1024);
      return megabytes.toFixed(2) + "MB";
  }
  </code></pre>
  
  <p>How can I do this?</p>