读书人

jquery ajaxFileUpload.js 插件在IE9中

发布时间: 2012-08-24 10:00:21 作者: rapoo

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

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

 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;                }}


将上面的代码修改为:

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中就支持文件的上传了

读书人网 >JavaScript

热点推荐