uploaddify 报错 "ID SWFUpload_0 is already in use. The Flash Object could not be added"
2016-08-25 09:01
381 查看
问题:使用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();
解决方案:修改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();
相关文章推荐
- uploadify"ID SWFUpload_0 is already in use..."错误的解决方法
- SqlServer2005 恢复数据库时出现Exclusive access could not be obtained because the database is in use 的解决方法
- [Solved]: System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use.
- SqlServer2005 恢复数据库时出现Exclusive access could not be obtained because the database is in use 的解决方法
- SqlServer2005 恢复数据库时出现Exclusive access could not be obtained because the database is in use 的解决方法
- Solution For "could not be located or a different control is assigned to the same ID after postback"
- Exclusive access could not be obtained because the database is in use
- 打开workspace时报错:could not launch the application because the associated workspace is currently in use
- The virtual machine could not be added. The virtual machine configuration could not be added. A configuration with this name already exists.
- 使用用sudo时提示"### is not in the sudoers file. This incident will be reported.
- Application "XXX" could not be found in the registry. The applications available are: .
- 打开一个VC工程提示"Not all of the windows in the workspace could be opened."
- You receive a "Setup Library wbemupgd.dll could not be loaded" error message when you use Add or Remove Programs in Windows Server 2003
- eclipse 3.4.2创建完项目时。报错Project "HelloWorld” is missing required source folder: ‘gen’The project could not be built until buid pat
- "The object cannot be deleted because it was not found in the ObjectStateManager."
- Application "XXX" could not be found in the registry的解决办法
- "The object cannot be deleted because it was not found in the ObjectStateManager."
- An object in the SharePoint administrative framework could not be deleted because other objects depend on it.
- the app xxx.app could not be added to your iTunes library because it is not a valid app
- 打开一个VC工程提示"Not all of the windows in the workspace could be opened."