Javascript addEventListener/onchange不在IE中工作

Javascript addEventListener/onchange不在IE中工作,javascript,jquery,html,outlook-addin,Javascript,Jquery,Html,Outlook Addin,我正在为outlook开发一个javascript插件 为了在outlook桌面上工作,我需要它在Internet explorer 11.648上运行。 因为在Outlook桌面的情况下,底层浏览器是IE 以下代码适用于chrome、firefox和MicrosoftEdge,但不适用于IE11。函数不会被调用 document.getElementById(“上传文档”).addEventListener(“更改”,函数(){ readURL(this); },假); 函数readURL(输

我正在为outlook开发一个javascript插件

为了在outlook桌面上工作,我需要它在Internet explorer 11.648上运行。 因为在Outlook桌面的情况下,底层浏览器是IE

以下代码适用于chrome、firefox和MicrosoftEdge,但不适用于IE11。函数不会被调用

document.getElementById(“上传文档”).addEventListener(“更改”,函数(){
readURL(this);
},假);
函数readURL(输入){
log(“读取调用的url”);
if(input.files&&input.files[0]){
var reader=new FileReader();
reader.onload=函数(e){
$('.image upload wrap').hide();
$('.file upload image').attr('src',e.target.result);
$('.file upload content').show();
$('.image title').html(输入.files[0].name);
};
reader.readAsDataURL(input.files[0]);
文件名=输入。文件[0]。名称;
var formData=new formData();
formData.append('document',input.files[0],input.files[0].name);
log(“在url之前读取url”);
变量url=”https://dev.paksign.pk/api/v1/profile/“+localStorage.getItem('profile-uuid')+”/document/”
$.ajax({
url:url,
键入:“post”,
标题:{
“授权”:“JWT”+localStorage.getItem(“JWT_令牌”)
},
数据:formData,
processData:false,
contentType:false,
成功:功能(数据){
document_id=data.uuid;
button=document.getElementById(“upload_next”);
button.disabled=false;
}
});
}否则{
removeUpload();
}
}

拖放文件。
其他选项

尝试了以下解决方案,他们在IE中也失败了

$('#upload_docu').on("change", function(){ readURL(this); });

<input class="file-upload-input" type='file' id="upload_docu" onclick="readURL(this);" accept="" />

<input class="file-upload-input" type='file' id="upload_docu" onchange="readURL(this);" accept="" />
$('#upload_docu')。on(“change”,function(){readURL(this);});

可能不支持FileReader API。可以检查是否为初学者定义了
窗口。FileReader
。没有关于FilereaderAPI支持的确凿证据,因为没有调用函数,控制台中没有打印任何内容。IE浏览器是否会说“Internet Explorer限制此网页在任何地方运行脚本或ActiveX控件”?我单击“允许”后,您的代码按预期工作并正确调用了onchange函数no,您从哪里得到此警告?控制台?无法复制。如果从函数
readFile
中删除除
console.log
之外的所有内容,该怎么办;你得到输出了吗?如果是这样,您可以添加多少代码直到它不再运行?