【发布时间】:2015-11-23 19:38:03
【问题描述】:
我正在使用 Angularjs 和 REST 来显示和检索 PDF。它在除 IE 之外的所有浏览器中都能正常工作。我正在使用 IE10。收到错误消息“拒绝访问”。需要一些帮助 。有没有办法解决这个问题。我在 html 页面中使用 Object 标签来显示 pdf。
HTML 源代码:
<object data="{{content}}" type="application/pdf" style="width: 100%; height: 700px;"></object>
js源码:
$http.get(url,{ responseType: 'arraybuffer' }).then(function(response){
var file = new Blob([response.data], {type: 'application/pdf'});
fileURL = URL.createObjectURL(file);
content = $sce.trustAsResourceUrl(fileURL);
});
Google 了很多,但找不到合适的解决方案。任何帮助表示赞赏。在此先感谢
【问题讨论】:
标签: html angularjs internet-explorer pdf