因为将“X-Frame-Options”设置为DENY facebook fb.ui共享方法,所以拒绝显示在一个框架中 [英] Refused to display in a frame because it set 'X-Frame-Options' to DENY facebook fb.ui share method
问题描述
在控制台中接收此消息:由于将X-Frame-Options设置为DENY
Receiving this message in the console: Refused to display in a frame because it set 'X-Frame-Options' to DENY
,因此在网站中出现此错误在移动版本中显示,如果用户代理是移动设备,则只提供一组不同的html和资产。
This happens when the site is being shown in the mobile version, its just a different set of html and assets served up if the user agent is a mobile device.
它显示m.facebook.com控制台错误消息。
It does display m.facebook.com in the console error message.
FB.ui(
{
method: 'share',
href: 'https://www.espn.com/mlb',
},
function(response) {
if (response && !response.error_code) {
console.log('shared_post');
//facebook_post_to_fanpage(access_token_data, link_id, song);
return true;
} else {
return false;
}
}
);
我可以在移动版本的网站上使用FB.api,以及登录和getauth没有任何问题,但它给我适合当我尝试使用FB.ui,分享和饲料方法。
I am able to use the FB.api on the mobile version of the site, as well as login and getauth without any problem, but it gives me fits when I try to use FB.ui, both the share and feed methods.
我想我会在清楚我是否正在使用Facebook javascript sdk。
I figured I'd be in the clear if I was using the facebook javascript sdk.
推荐答案
我从这篇文章得到我的解决方案:加载iframe Facebook(X-Frame-Options拒绝加载)
I got my solution from this post: Loading Iframe Facebook (Load denied by X-Frame-Options)
我遇到了同样的问题,当我将target =_ top用于链接时,它已经修复了,现在它正在正常工作。 p>
I got the same issue, and it got fixed, when i used target="_top" for the link , and it is now working perfectly.
这篇关于因为将“X-Frame-Options”设置为DENY facebook fb.ui共享方法,所以拒绝显示在一个框架中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!