ie 下uploadify上传插件失效报错

现象:js报错或者按钮需要点击两次才有效


报错信息如下:



解决方法:jquery.uploadify.min.js

原代码:

SWFUpload.prototype.cleanUp = function(a) {
    try {
        if (this.movieElement && typeof(a.CallFunction) === "unknown") {
            this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
            for (var c in a) {
                try {
                    if (typeof(a[c]) === "function") {
                        a[c] = null
                    }
                } catch(b) {}
            }
        }
    } catch(d) {}
    window.__flash__removeCallback = function(e, f) {
        try {
            if (e) {
                e[f] = null
            }
        } catch(g) {}
    }
};

解决后代码:

SWFUpload.prototype.cleanUp = function(f) {
    try {
        if (this.movieElement && typeof(f.CallFunction) === "unknown") {
            this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
            for (var h in f) {
                try {
	            // 只有这里加了个条件   【 && h[0] >= 'A' && h[0] <= 'Z'】
                    if (typeof(f[h]) === "function"  && h[0] >= 'A' && h[0] <= 'Z') {
                        f[h] = null;
                    }
                } catch(e) {}
            }
        }
    } catch(g) {}
    window.__flash__removeCallback = function(c, b) {
        try {
            if (c) {
                c[b] = null;
            }
        } catch(a) {}
    };
};


注意事项:一定要注意自己项目中是引入的哪个js文件,然后修改对应用到的js文件即可!

jquery.uploadify.js

jquery.uploadify.min.js



其他:使用uploadify插件实现上传时,需要把swf文件和其他所有js,css文件放到当前项目的同一个目录下





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值