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