2016-12-25 73 views
0

我正在尝试将PDF插入到使用iframe的博客中,但我正在变得空白页 任何想法如何解决它。我用chrome和firefox获得空白页面。我得到错误“这个出版商不允许出版的”在Internet Exploreriframe到blogspot无法正常工作

> <iframe width="100%" frameborder="0" 
> src="https://drive.google.com/file/d/0B15mEFBok9BVUExXV2lRTDNsYjQ/view?usp=sharing"></iframe> 

enter image description here

回答

1

好像谷歌云端硬盘提供了HTTP报头X-Frame-Options设置为SAMEORIGIN。这意味着它只能嵌入在同一个域中(drive.google.com)。你可以阅读更多关于它在这里:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

您应该能够打开浏览器的控制台来查看错误:

Refused to display 'https://drive.google.com/file/u/2/d/0B15mEFBok9BVUExXV2lRTDNsYjQ/view?usp=sharing' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.` 

我的建议是托管到其他地方(如亚马逊S3),在那里你可以控制HTTP标头。