在系统测试过程中,发现使用了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 ['',
'',
'',
'',
'',
'',
''].join();
};
保存,运行就可以看到效果了,完美!
