title: How to call a jquery function inside template (type="text/x-tmpl") jquery?
body: <p>Hi all i am working on jquery i need to call a function in ('text/x-tmpl') template i have this 
   I am trying to run this javascript code, it doesnt work, wht is the process make it run
   is there any body please help  </p>
  
  <pre><code>&lt;script id="template-upload" type="text/x-tmpl"&gt;
  
       checkbox();
  
  {% for (var i=0, file; file=o.files[i]; i++) { %}    
      &lt;ul class="template-upload fade imagePeiview"&gt;
  
          &lt;li class="preview"&gt;&lt;span class="fade image-gallery-thumb"&gt;&lt;/span&gt;&lt;/li&gt;
          &lt;li class="name"&gt;&lt;span class="imgname"&gt;{%=file.name%}&lt;/span&gt; &lt;/li&gt;
          &lt;li class="size"&gt;&lt;span&gt;{%=o.formatFileSize(file.size)%}&lt;/span&gt;&lt;/li&gt;
  
  
          &lt;li class="cancel"&gt;{% if (!i) { %}
              &lt;button style="display:none" class="btn btn-info"&gt;
  
                  &lt;span&gt;{%=locale.fileupload.cancel%}&lt;/span&gt;
              &lt;/button&gt;
          {% } %}&lt;/li&gt;
      &lt;/ul&gt;
  {% } %}
  &lt;/script&gt; 
  
  
  
  &lt;script type="text/javascript"&gt;
      jQuery(document).ready(function () {
          function checkbox() {
              alert(1);
          }
  });
  
  &lt;/script&gt; 
  </code></pre>