【问题标题】:JQuery fileupload and ie9JQuery 文件上传和 ie9
【发布时间】:2014-05-15 17:35:56
【问题描述】:

出于某种原因,ie9 不会向服务器上传任何内容,也不会触发失败、成功或完成回调。这是我的代码:

HTML:

<label class="profile-image-container btn-act-green" id="fileupload" data-url="{% url 'festival_registration_file_upload' uidb36 token %}" for="id_image_upload">
    <input type="file" name="image_upload[image_upload]" id="id_image_upload" accept="image/*" multiple>
</label>

js:

    $(this).find('input[type="file"]').fileupload({
        url: $el_root.attr('data-url'),
        forceIframeTransport: true,
        autoUpload: true,
        dataType: 'json',

        add: function(e, data) {
            data.submit();
        },
        fail: function(e,data) {
            alert('fail')
        },
        success: function(e, data) {
            alert('success')
        },
        done: function(e, data) {
            $progress_bar.css('width', '0%');
            $el_root.addClass('image-uplaoded').removeClass("error");
            $('#id_profile_image').val(data.result.fields.image_upload);

            $image_tag.attr({
                'src': data.result.image_url,
                'width': image_width,
                'height': image_height,
                'position': 'absolute'
            }).css({
                'top': 0,
                'left': 0
            });
        },
        progressall: function (e, data) {
            var progress = parseInt(data.loaded / data.total * 100, 10);
            $('.progress-bar').css(
                'width',
                progress + '%'
            );
        }
    })

有人发现问题了吗?

我在虚拟机上测试:win7和ie9

【问题讨论】:

  • 我知道文件加载,因为如果我将警报('add')放在添加函数中,它会向我显示警报框。控制台没有错误
  • 嗨乔纳斯,你能解决这个问题吗?您在一年多前发布。如果是这样,你能记得你做了什么吗?
  • 对不起,不,已经过了太多时间。

标签: jquery file-upload internet-explorer-9


【解决方案1】:

IE9 对插件的支持似乎很粗略。

herehere。另见browser support

编辑:在上面的第二个链接中,插件创建者提供了有关如何修复它的说明。不幸的是,我没有这方面的任何经验,所以我无法为您提供更多帮助。

【讨论】:

  • 两个链接都失效了... ;-(
猜你喜欢
  • 2014-03-14
  • 2015-11-29
  • 2016-02-04
  • 2014-03-03
  • 1970-01-01
  • 2014-04-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多