BUG:ie9不显示上传按钮(部分IE9版本可能不会有问题,)
解决:如果是IE9,在swfupload.js的getFlashHTML函数加上classid.
SWFUpload.prototype.getFlashHTML = function () {
var classid="";
if (window.ActiveXObject) {
var ieVersion=navigator.userAgent.toLowerCase().match(/msie ([\d.]+)/)[1];
if(ieVersion&&ieVersion.substring(0, 1) == "9"){
classid = 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
}
}
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
return ['<object ', 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">',
'<param name="wmode" value="', this.settings.button_window_mode, '" />',
'<param name="movie" value="', this.settings.flash_url, '" />',
'<param name="quality" value="high" />',
'<param name="menu" value="false" />',
'<param name="allowScriptAccess" value="always" />',
'<param name="flashvars" value="' + this.getFlashVars() + '" />',
'</object>'].join("");
};
使用例子及SWFUpload v2.2.0.1源码下载:http://download.csdn.net/detail/xiejx618/7415911