uploaddify 报错 "ID SWFUpload_0 is already in use. The Flash Object could not be added"

问题:使用uploadify组件时,当一个页面多次加载这个组件的时候,就会报这个错,ID SWFUpload_0 is already in use. The Flash Object could not be added;大概的意思就是ID重复了。查找了一下解决办法记录一下。

解决方案:修改uploadify.js中的一段代码

SWFUpload.prototype.initSWFUpload = function(b) {
    try {
        this.customSettings = {};
        this.settings = b;
        this.eventQueue = [];
        this.movieName = "SWFUpload_" + SWFUpload.movieCount++;   
        this.movieElement = null;
        SWFUpload.instances[this.movieName] = this;
        this.initSettings();
        this.loadFlash();
        this.displayDebugInfo()
    } catch(a) {
        delete SWFUpload.instances[this.movieName];
        throw a
    }
};

就是这句,将加号后面的换成可以唯一标识的就可以了,比如系统当前时间。

   var mydate = new Date();
    this.movieName = "SWFUpload_" + mydate.getTime().toString();    

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值