当前位置:编程学习 > JS >>

jquery ajaxFileUpload.js 插件在IE9中的bug修复

在ajaxfileupload.js中找到如下代码:

 

[javascript] 
 if(window.ActiveXObject) { 
                var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />'); 
                if(typeof uri== 'boolean'){ 
                    io.src = 'javascript:false'; 
                } 
                else if(typeof uri== 'string'){ 
                    io.src = uri; 
                } 

将上面的代码修改为:

[javascript]
if(window.ActiveXObject) { 
                if(jQuery.browser.version=="9.0") { 
                    io = document.createElement('iframe'); 
                    io.id = frameId; 
                    io.name = frameId; 
                } else if(jQuery.browser.version=="6.0"||jQuery.browser.version=="7.0"||jQuery.browser.version=="8.0") { 
                    var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />'); 
                    if(typeof uri== 'boolean'){ 
                        io.src = 'javascript:false'; 
                    } 
                    else if(typeof uri== 'string'){ 
                        io.src = uri; 
                    } 
                } 

 这样,ajaxFileUpload在IE9中就支持文件的上传了


作者:zyk906705975
补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,