IE10不显示swfupload上传附件按钮问题

IE11正常显示swfupload上传附件按钮,但是IE10不显示,遇到浏览器兼容问题,只需改swfupload.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,吧这两行代码中间的内容替换成下面代码

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 [', classid, ' 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">',  
                '" value="', this.settings.button_window_mode, '" />',  
                '" value="', (this.settings.flash_url), '" />',  
                '" value="high" />',  
                '" value="always" />',  
                '" value="' + this.getFlashVars() + '" />',  
                ''].join("");  
}; 

页面引入swfupload.js,保存运行即可解决该问题

你可能感兴趣的:(IE兼容)