熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

SwfUpload在IE10上不出現上傳按鈕的解決方法

2013-11-15 12:03:08  來源: JSP教程 

  在系統測試過程中發現使用了SwfUpload實現的無刷新上傳功能在IE上竟然無法使用了難道SwfUpload不支持嗎?還是需要換一種實現方式呢?最後通過了解SwfUpladJS文件發現我們是可以修改的讓其支持IE具體解決方案如下

打 開SwfUploadjs在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了
 

復制代碼 代碼如下:
SWFUploadprototypegetFlashHTML = function (flashVersion) {
// Flash Satay object syntax:
var classid = "";
var Sys = {};
var ua = navigatoruserAgenttoLowerCase();
if (windowActiveXObject) {
Sysie = uamatch(/msie ([d]+)/)[];
if (Sysie && Sysiesubstring( ) == "" || Sysiesubstring( ) == "") {
classid = classid = "clsid:dcdbeaedcfb";
}
}
return [<object classid id=" thismovieName " type="application/xshockwaveflash" data=" (thissupportimageResize ? thissettingsflash_url : thissettingsflash_url) " width=" thissettingsbutton_width " height=" thissettingsbutton_height " class="swfupload">
<param name="wmode" value=" thissettingsbutton_window_mode " />
<param name="movie" value=" (thissupportimageResize ? thissettingsflash_url : thissettingsflash_url) " />
<param name="quality" value="high" />
<param name="allowScriptAccess" value="always" />
<param name="flashvars" value=" + thisgetFlashVars() + " />
</object>]join("");
};

  
保存運行就可以看到效果了完美!


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20171.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.