解决uploadify在使用IE内核等浏览器无法使用

时间:2021-11-23 20:57:38

有两种方法:

第一种:

SWFUpload Version: 2.2.0 Beta 2

Flash Player Version: current

Operating System:Window 7

Browser(s):IE9 in standard conform mode

Description:

We have found that IE9 takes 1 - 2 minutes to display the upload buttons.

This problem can be fixed by adding a "classid" attribute to the object tag which is returned by SWFUpload.getFlashHTML(), i.e. by changing the source to read:

SWFUpload.prototype.getFlashHTML = function () {

 // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay

 return ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 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.prototype.getFlashHTML = function () {

 // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay

 var obj = ['<object 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">'].join(""),

 params = [

  '<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(), '" />'

 ].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.settings.flash_url + '" />';

 }

 return [obj, params, '</object>'].join("");

};

我用的第一种,可以实现。

参考文章:http://code.google.com/p/swfupload/issues/detail?id=371&can=1&q=IE9&colspec=ID%20Type%20Status%20Summary%20FixReleasedIn%20FixTargetedFor%20Modifi

进一步深入解释:http://blog.longwin.com.tw/2011/10/html-object-flash-classid-2011/