【问题标题】:How can I make this file upload jQuery code work in IE8?如何让这个文件上传 jQuery 代码在 IE8 中工作?
【发布时间】:2014-02-10 16:06:02
【问题描述】:

我的部分代码:

$("input[name='image']", selector_id).each(function(index) {
    var this_selector = $(this),
        this_file = this_selector[0].files[0], // ERROR LINE
        this_image;

    if (this_file) {
        this_image = new FormData();
        this_image.append('image', this_file);  
        images.push(this_image);
    }
}); 

我正在使用 jQuery 通过 AJAX 上传图像,在 IE

如何在 IE8-9 中进行这项工作?

编辑 - 让我重新表述我的问题:我知道其中一些东西在 IE

【问题讨论】:

标签: javascript jquery internet-explorer internet-explorer-8 polyfills


【解决方案1】:

对于不支持 FormData 的浏览器,解决此问题的唯一方法是提交到隐藏的 iframe,或使用 flash。有很多插件可以为你做这件事,或者你可以自己动手,因为它真的不难实现(它甚至不需要 javascript。)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-18
    • 1970-01-01
    相关资源
    最近更新 更多