在系统测试过程中,发现使用了SwfUpload实现的无刷新上传功能,在IE10上竟然无法使用了,难道SwfUpload不支持吗?还是需要换一种实现方式呢?最后通过了解SwfUplad.JS文件发现,我们是可以修改的,让其支持IE10,具体解决方案如下:

打开SwfUpload.js,在js文件中找到// Private: getFlashHTML generates the object tag needed to embed the flash in to the document”这行和“// Private: getFlashVars builds the parameter string that will be passed”和这行,然后把中间的用如下代码替换就OK了

复制代码 代码如下:
SWFUpload.prototype.getFlashHTML = function (flashVersion) {
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
var classid = "";
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
if (window.ActiveXObject) {
Sys.ie = ua.match(/msie ([\d.]+)/)[1];
if (Sys.ie && Sys.ie.substring(0, 1) == "9" || Sys.ie.substring(0, 2) == "10") {
classid = ' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';
}
}
return ['<object', classid, ' id="', this.movieName, '" type="application/x-shockwave-flash" data="', (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url), '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
'<param name="wmode" value="', this.settings.button_window_mode, '" />',
'<param name="movie" value="', (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url), '" />',
'<param name="quality" value="high" />',
'<param name="allowScriptAccess" value="always" />',
'<param name="flashvars" value="' + this.getFlashVars() + '" />',
'</object>'].join("");
};

保存,运行就可以看到效果了,完美!
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com