swfupload在IE下不再起作用 [英] swfupload not working under IE anymore
问题描述
http://demo.swfupload.org/v250beta2/simpledemo/index.php 在IE中似乎不再起作用.有解决办法吗?
http://demo.swfupload.org/v250beta2/simpledemo/index.php doesn't seem to work in IE any more. Is there a fix for this?
我得到一个红叉,并且按钮"不可点击.
I get a red cross instead and the 'button' is not clickable.
我正在运行IE 8.
推荐答案
我可以重现Windows 7上运行的IE9的问题,但只能在虚拟机上运行.无论如何,由于
I could reproduce the problem with IE9 running on Windows 7, but only on virtual machines. Anyway, I was able to apply a quick'n'dirty to fix the problem by patching swfupload.js (v2.2.0), somewhere around line 230, thanks to this post.
SWFUpload.prototype.getFlashHTML = function () {
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
// ADD THESE LINES -->
var iefix = '';
if(navigator.userAgent.search(/MSIE/) > -1){
iefix = 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
}
// MODIFY THIS LINE: (add ' + iefix + ')
return ['<object ' + iefix + ' id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
'<param name="wmode" value="', this.settings.button_window_mode, '" />',
...
似乎非常相似的修复程序可能对2.5.0有帮助.
Seems that a very similar fix might help for 2.5.0.
编辑:对于某些启用了IE附加组件"VMware Adobe Flash Optimizer"的VM来说,此修复似乎还不够.出于某种原因,优化器会将Flash影片变成一个白框(如果您知道单击它,则实际上可以单击它).
it seems that this fix wasn't enough for some VM's that have an IE add-on called "VMware Adobe Flash Optimizer" enabled. For some reason, the optimizer turns the Flash movie to a white box (which is actually clickable if you know to click it).
坏消息是,我找不到在我的代码中检测或禁用优化程序附加组件的方法.因此,我无法确定用户实际上是看到按钮还是仅看到白框.我发现没有好的解决方法,只是向非Flash上传表单中添加了一个后备链接.
The bad news is that I found no way to detect or disable the presence of the optimizer add-on in my code. So I can't be sure whether the user actually sees the button or only a white box. I found no good workaround, only added a fallback link to a non-Flash uploading form.
这篇关于swfupload在IE下不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!