2014-12-05 66 views
0

我正在使用blueimp的jQuery文件上传来面对奇怪的情况。Blueimp的jQuery文件上传多个IE实例8

我的代码是如此简单:

<div><input type="file" name="files" id="f1"></div> 
<div><input type="file" name="files" id="f2"></div> 


<script> 
$("input:file").each(function() { 
    $(this).fileupload({ 
     url: "./?a=upload&t=", 
     dataType: 'json', 

     add: function (e, data) { 
      alert("add"); 
      /* same as default implementation */ 
      if (data.autoUpload || (data.autoUpload !== false && 
        $(this).fileupload('option', 'autoUpload'))) { 
       data.process().done(function() { 
        data.submit(); 
       }); 
      } 
     }, 

     start: function (e) { 
      alert("start"); 
     } 
    }); 
}); 
</script> 

一切工作正常在Firefox和Chrome:对任何输入时,点击字段消息“add”和“启动”中显示和请求是提交。

在IE 8中的两个实例似乎要创建(加载页面时,我没有得到任何错误),但是当我点击一个文件的输入和选择要上传的文件,只有“加”的提示信息,然后IE触发错误:

cannot call methods on fileupload prior to initialization; attempted to call method 'process' 

有页面只有一个文件输入控制工作正常,所以我想这个问题必须是与多个实例。

我使用jQuery插件上传9.8.1和jQuery 1.11.1。

在此先感谢。

回答

1

与IE8尝试了演示页面(here),这是行不通的(尽管演示页声称它应该)。

+0

我在这里有相同的行为,演示页面在IE 8中不起作用 – 2015-01-09 13:40:58

相关问题