Uploadify在ie11下出现"SCRIPT5007: 缺少对象 "

看了这里说的:https://www.cnblogs.com/LLLLLLL/p/5345627.html

起因:升级了IE11之后部分页面刷新时会出现"SCRIPT5007: 缺少对象 "的报错,查看之后发现是Uploadify目前不支持IE11。

每次打开页面就报错,IE11上传后不能继续执行其他js,除了IE11都可以。

以下操作并没有解决我的问题:

在页面头部添加<meta http-equiv="X-UA-Compatible" content="IE=edge" >    

通过在meta中设置X-UA-Compatible的值,指定IE8/9及以后的版本都会以最高版本IE来渲染页面。 

我参考的修改源码方法:

//原来的代码是
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 {
                    if (typeof(f[h]) === "function") {
                        f[h] = null;
                    }
                } catch(e) {}
            }
        }
    } catch(g) {}
    window.__flash__removeCallback = function(c, b) {
        try {
            if (c) {
                c[b] = null;
            }
        } catch(a) {}
    };
};

修改后

//新代码
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 {
                    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) {}
    };
};

改了源码终于解决了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值