【发布时间】:2013-06-07 14:28:26
【问题描述】:
我正在使用下面的代码打开一个本地文本文件。它在 firefox 中工作正常,但在 safari 中我得到错误为 '[object BlobConstructor]' 不是构造函数(评估'new Blob([xhr.response])')。请提供链接帮助我。
var xhr = new XMLHttpRequest(),blob;
xhr.open('GET', 'example.txt');
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
blob = new Blob([xhr.response]);
console.log(blob);
}
【问题讨论】:
标签: safari xmlhttprequest blob