Javascript createObjectURL在ie10中不起作用

Javascript createObjectURL在ie10中不起作用,javascript,Javascript,我正在从indexedDB读取一个base64编码的文件,并尝试将其作为blob url链接到该文件。下面的代码在Chrome中运行良好,但当我点击ie10中的链接时,什么也没发生。我可以在链接的属性上看到href是blob:66A3E18D-BAD6-44A4-A35A-75B3469E392B,这似乎是正确的。有人知道我做错了什么吗 下载附件 //convert the base64 encoded attachment string back into a binar

我正在从indexedDB读取一个base64编码的文件,并尝试将其作为blob url链接到该文件。下面的代码在Chrome中运行良好,但当我点击ie10中的链接时,什么也没发生。我可以在链接的属性上看到href是blob:66A3E18D-BAD6-44A4-A35A-75B3469E392B,这似乎是正确的。有人知道我做错了什么吗

下载附件

           //convert the base64 encoded attachment string back into a binary array
            var binary = atob(attachment.data);
            var array = [];
            for(var i = 0; i < binary.length; i++) {
                array.push(binary.charCodeAt(i));
            }

            //create a blob from the binary array
            var myBlob=new Blob([new Uint8Array(array)], {type: attachment.content_type});

            //create a url hooked to the blob
            downloadURL = (window.webkitURL ? webkitURL : URL).createObjectURL(myBlob);

            //set the attachment link to the url
            $('#attachmentLink').attr("href", downloadURL);
            $("#attachmentLink").text(fileName);
//将base64编码的附件字符串转换回二进制数组
var二进制=atob(附件数据);
var数组=[];
对于(var i=0;i
找到了答案。IE10不想在新窗口中打开blobURL,正如我上面的代码所尝试的那样。只有当我将blob url设置为img标记的src以显示我的文件时,我才能做到这一点,幸运的是,这无论如何都是一个图像。

您是否查阅过IE的开发工具以查看是否遇到错误?它是否适用于IE 11中超过1024字节的文件?这仅适用于某些文件图像/css,与数据URL不同,对象URL的文件大小应该无关紧要。