我在移动应用程序上有这个 html:
<header class="bar-title">
<a class="button-prev" onclick="history.back(-1)">
BACK
</a>
<h1 class="title">FACEBOOK</h1>
</header>
<div style="overflow:auto;-webkit-overflow-scrolling:touch; height: 100%; width: 100%; padding-top: 42px;" >
<iframe style="height: 100%; width: 100%;" src="https://www.facebook.com/pages/SOMEPAGE" ></iframe>
</div>
但我得到错误: 拒绝显示“https://www.facebook.com/pages/SOMEPAGE” ' 在框架中,因为它将 'X-Frame-Options' 设置为 'DENY'
小评论:我没有访问 facebook 页面选项的权限
最佳答案
X-Frame-Options
是响应 header 。
The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a or . Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.
这意味着 facebook 阻止了这种行为
关于javascript - 访问 iframe 中的 facebook 页面被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20631062/