我在本节的Windows 7中的safari中遇到此错误
'[object BlobConstructor]' is not a constructor (evaluating 'new Blob([data], {type: 'application/pdf'})')
使用Blob constructor not working in safari / opera?
的解决方案后'[object BlobConstructor]' is not a constructor (evaluating 'new Blob([data.buffer], {type: 'application/pdf'})')
我正在使用此Blob
代码
var file = new Blob([data], {type: 'application/pdf'});
完整的代码是
$scope.pdffile = "";
$http.get('/api/myurl/'+report_id, {responseType: 'arraybuffer'})
.success(function (data) {
var file = new Blob([data], {type: 'application/pdf'});
var fileURL = URL.createObjectURL(file);
$scope.pdfcontent = $sce.trustAsResourceUrl(fileURL);
$scope.pdffile = "download.pdf";
$scope.loading = false;
});
答案 0 :(得分:2)
2012年Safari 6的Apple drops Windows support。
显然你正在使用版本5 does not supports Blob API。