SWFupload在IE9中无法点击bug解决方法

用swfupload是出现了再IE9下那选择文件的按钮无法点击的情况,在其他浏览器,例如Firefox、chrome都不会出现

出现这种情况,需要在swfupload.js中的getFlahHTML方法修改一下


SWFUpload.prototype.getFlashHTML = function (flashVersion) {
	// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
    var obj = ['<object 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">'].join(""),
	params = [
		'<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="menu" value="false" />',
		'<param name="allowScriptAccess" value="always" />',
		'<param name="flashvars" value="', this.getFlashVars(), '" />'
	].join("");
	if (navigator.userAgent.search(/MSIE/) > -1){
		obj = ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="', this.movieName, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">'].join("");
		params += '<param name="src" value="' + (this.support.imageResize ? this.settings.flash_url : this.settings.flash9_url) + '" />';
	}
	return [obj, params, '</object>'].join("");
};

Reference:

http://www.zamen.name/post/16.html

http://www.yourannet.com/net-2/dotnet-swfupload-upload-picture

https://code.google.com/p/swfupload/issues/detail?id=348

http://vanchee.iteye.com/blog/1625383


你可能感兴趣的:(ie9,bug,swfupload,显示)