facebook like button not displaying :: FB.getLoginStatus() called before calling FB.init()

情到浓时终转凉″ 提交于 2019-11-29 06:59:08

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

Are you testing it locally? After debugging and searching quite a bit myself, I decided to test it on a webserver of mine, and voila, it worked! :)

On the Facebook Developer page where we obtain the script for the Like Button, Facebook says nothing of needing to implement the init() as well (which would presumably solve this problem, but what WOULD you use as the APP ID if you also called the init() function ??).

And an APP ID is not needed anyway for the Like Button to work. I believe that Facebook is just giving us the Like Button code -- even though the absence of the init() function is going to cause this js error (but apparently the init() is not actually needed!).

This seems like a shortcoming in FB's deployment of the Like Button API.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!