这是一个html文件,代码如下:
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
...不知道{% %}是什么东东,是php代码吗? 还是javascript本身的语法?网上查了一下也没查到

解决方案 »

  1.   

    <script id="template-upload" type="text/x-tmpl">
    {% 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>
      

  2.   


    你这个是一个模板引擎的语法,至于是asp还是php语言的模板引擎,这个就要看你的程序了,如果你的程序是php,那就是php的一种模板引擎的语法那么该程序里会有一个这个模板引擎的替换函数,换成正常的
    if(file.error){
    }
    的格式的
      

  3.   

    这个是模板引擎的语法(语法是可以自定义的),你可以看一下引用文件是php文件,还是其他文件!
      

  4.   

    这个项目中肯定还有其他文件,找下。应该有.php的文件或者其他的
      

  5.   


    https://github.com/blueimp/jQuery-File-Upload 中的 index.html
      

  6.   


    项目中有其他的php文件,但不懂php语法
    项目是开源的https://github.com/blueimp/jQuery-File-Upload  这段代码是 index.html中的
      

  7.   

    {%  %}自定义的模版开始和结束符 里面可以输入php模版代码
      

  8.   

    当文件有任何错误时,如文件类型被禁止,文件大小不符合约定,会得到file.error。
    http://avnpc.com/pages/single-file-upload-component-by-jquery-file-upload
      

  9.   

    asp的标记符,{% %}跟php中的<? ?>一个意思
      

  10.   

    blueimp的javascript模板,项目网址
    https://github.com/blueimp/JavaScript-Templates