加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

uploadify"ID SWFUpload_0 is already in use...&#3

发布时间:2020-12-15 20:09:55 所属栏目:百科 来源:网络整理
导读:在使用 uploadify时 遇到同时加载的多个页面中包含uploadify组件时就会出现“ID SWFUpload_0 is already in use. The Flash Object could not be added”的错误,分析代码就会发现,时因为名字累加的问题,解决方法如下 SWFUpload.prototype.initSWFUpload =

在使用 uploadify时 遇到同时加载的多个页面中包含uploadify组件时就会出现“ID SWFUpload_0 is already in use. The Flash Object could not be added”的错误,分析代码就会发现,时因为名字累加的问题,解决方法如下

SWFUpload.prototype.initSWFUpload = function (settings) {
try {
    this.customSettings = {};   // A container where developers can place their own settings associated with this instance.
    this.settings = settings;
    this.eventQueue = [];

    //this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
    //名称重复  SWFUpload.movieCount++不能有效累加导致出现重名现象
    //this.movieName = "SWFUpload_" + parseInt(100*Math.random());
    //,从而修改为随机数   modify by 志超 2015.05.21
    var mydate = new Date();
    this.movieName = "SWFUpload_" + mydate.getTime().toString();

//,从而修改为随机数 modify by 志超 2015.09.07

this.movieElement = null;


        // Setup global control tracking
    SWFUpload.instances[this.movieName] = this;

    // Load the settings.  Load the Flash movie.
    this.initSettings();
    this.loadFlash();
    this.displayDebugInfo();
} catch (ex) {
    delete SWFUpload.instances[this.movieName];
    throw ex;
}
};

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读