0
我可以看到API响应中返回的图像,但无法将其设置为IE 10/11中的页面中img元素的src。 在Chrome中,此ReactJS代码工作正常:IE 10/11:来自API响应的图像预览
return fetch(url, sInit)
.then(response => response.blob())
.then((blobResponse) => {
let fileUrl = (window.URL || window.webkitURL).createObjectURL(blobResponse);
// setting fileUrl as src for <img>
});
这fileUrl然后被设定为一个img元素的src属性。
但我需要为IE 10/11的解决方案,以便可以在指定的位置预览图像。
说明:window.navigator.msSaveOrOpenBlob
的解决方法不是我所需要的。
您使用的填充工具为'取()'在IE10/11? (因为'fetch()'[不支持IE10/11](https://caniuse.com/#search=fetch))。 – K3N
是的,这是正确的。 –