facebook like button not displayed :: FB.getLoginStatus()在调用FB.init()之前调用 [英] facebook like button not displaying :: FB.getLoginStatus() called before calling FB.init()

查看:114
本文介绍了facebook like button not displayed :: FB.getLoginStatus()在调用FB.init()之前调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想要一个基本的Facebook,如我的网站上的按钮。我按照每个Facebook网站的说明(http://developers.facebook.com/docs/reference/plugins/like/)。我尝试了 HTML5 XFBML iFrame 也没有喜悦。所以我想也许这是我的网站的干扰。所以我创建了一个如下所示的裸机html页面,它仍然给我调用 FB.init()之前调用的 FB.getLoginStatus() / code>错误。

 < html> 
< body>
< div id =fb-root>< / div>
< script>(function(d,s,id){
var js,fjs = d.getElementsByTagName(s)[0];
if(d.getElementById(id) return;
js = d.createElement(s); js.id = id;
js.src =//connect.facebook.net/en_US/all.js#xfbml=1;
fjs.parentNode.insertBefore(js,fjs);
}(document,'script','facebook-jssdk'));< / script>
< div class =fb-likedata-href =http://www.facebook.com/[mypage]data-send =falsedata-width =450data-show -faces = 假 >< / DIV>
< / body>
< / html>

更新:我删除了上述所有东西都回到 iFrame 只有方法,它的工作原理,但只在Firefox。 Chrome和IE9我仍然没有收到任何错误,但没有报告错误。为什么这行以下只在FireFox中工作(显然[myPage]部分被换出)?

 < iframe src = //www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2F[myPage]&amp;send=false&amp;layout=standard&amp;width = 450& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; hidden; width:450px; height:35px; ALLOWTRANSPARENCY = 真 >< / iframe中> 


解决方案

不知道应用程序ID是这里的问题。我也经历了这个奇怪的错误消息,我只是包含FB Like Button社交插件的标准代码,由FB开发者页面提供。



然后我再次通过插件配置页面再次复制代码,这反正没有改变注意到生成代码的HTML部分有一点差异(是一个< fb:like> 标签,现在是 < div class =fb-like>
无论如何,错误仍然存​​在。



然后我刚刚意识到,在几周之内,FB Like Button将永久迁移到内置像开放操作图表,如果我的确正确,您创建一个应用程序ID。



在这一点上,错误可能只是消失。而且,几个星期内,任何人都很难对任何事情进行修改。



HTH


I just want a basic facebook like button on my site. I follow the instructions per facebooks site (http://developers.facebook.com/docs/reference/plugins/like/). I tried the HTML5, XFBML, and iFrame ways, no joy on either. So I thought maybe it's something with my site interfering. So I created a bare-bones html page like below and it still gives me the FB.getLoginStatus() called before calling FB.init() error.

<html>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="http://www.facebook.com/[mypage]" data-send="false" data-width="450" data-show-faces="false"></div>
</body>
</html>

UPDATE: I removed all that stuff above went back to the iFrame only method and it works, but only in Firefox. Chrome and IE9 I still get nothing but no errors reported. Why is this line below only working in FireFox (obviously the [myPage] part is swapped out)?

 <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2F[myPage]&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>

解决方案

Not sure the App ID is the problem here. I'm also experiencing this strange error message, and I'm just including standard code for FB Like Button social plugin, provided by FB developer page.

I then went again through the plugin configuration page and copied again code, which anyway was unchanged noticing little difference in the HTML part of generated code (was a <fb:like> tag, now is <div class="fb-like">). Anyway error still persists.

Then I just realised that in a few weeks FB Like Button will migrate permanently to Built-in Like action for Open Graph, and if I got it correctly you have to create an App ID anyway.

At that point the error might just disappear. And it seems difficult that anyone will fix anything on something that's going to disappear in a few weeks.

HTH

这篇关于facebook like button not displayed :: FB.getLoginStatus()在调用FB.init()之前调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆