在系统测试过程中发现使用了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(""); }; 保存运行就可以看到效果了完美! |