2011-12-26 6 views
1

に何を意味するスクリプトはここ{%は私が<a href="https://github.com/blueimp/jQuery-File-Upload" rel="nofollow">https://github.com/blueimp/jQuery-File-Upload</a></p> <p>でのGithubからこのスクリプトを使用しようとしているJavaScriptの

<script id="template-upload" type="text/html"> 
    {% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %} 
     <tr class="template-upload fade"> 
      <td class="preview"><span class="fade"></span></td> 
      <td class="name">{%=file.name%}</td> 
      <td class="size">{%=o.formatFileSize(file.size)%}</td> 
      {% if (file.error) { %} 
       <td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td> 
      {% } else if (o.files.valid && !i) { %} 
       <td class="progress"><div class="progressbar"><div style="width:0%;"></div></div></td> 
       <td class="start">{% if (!o.options.autoUpload) { %}<button class="btn primary">Start</button>{% } %}</td> 
      {% } else { %} 
       <td colspan="2"></td> 
      {% } %} 
      <td class="cancel">{% if (!i) { %}<button class="btn info">Cancel</button>{% } %}</td> 
     </tr> 
    {% } %} 
    </script> 
  • のようなjsのコードを持って、{%または%}は何を意味するのでしょうか?
  • なぜスクリプトタグにidがあるのですか?その使用は何ですか、私は今までに を見たことがありませんでしたか?
  • スクリプトtype="text/html"は何を意味していますか?私はいつも type="text/javascript"を使っていました。
+5

純粋なJavaScriptですか?何もない。テンプレートエンジンでは、 '

関連する問題

 関連する問題