这是一个html文件,代码如下:
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
...不知道{% %}是什么东东,是php代码吗? 还是javascript本身的语法?网上查了一下也没查到
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
...不知道{% %}是什么东东,是php代码吗? 还是javascript本身的语法?网上查了一下也没查到
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td>
<span class="preview"></span>
</td>
<td>
<p class="name">{%=file.name%}</p>
{% if (file.error) { %}
<div><span class="label label-danger">Error</span> {%=file.error%}</div>
{% } %}
</td>
<td>
<p class="size">{%=o.formatFileSize(file.size)%}</p>
{% if (!o.files.error) { %}
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
{% } %}
</td>
你这个是一个模板引擎的语法,至于是asp还是php语言的模板引擎,这个就要看你的程序了,如果你的程序是php,那就是php的一种模板引擎的语法那么该程序里会有一个这个模板引擎的替换函数,换成正常的
if(file.error){
}
的格式的
https://github.com/blueimp/jQuery-File-Upload 中的 index.html
项目中有其他的php文件,但不懂php语法
项目是开源的https://github.com/blueimp/jQuery-File-Upload 这段代码是 index.html中的
http://avnpc.com/pages/single-file-upload-component-by-jquery-file-upload
https://github.com/blueimp/JavaScript-Templates