Facebook Like Box不起作用 [英] Facebook Like Box doesn't work
问题描述
我一直在为客户提供类似Facebook的问题,而我和朋友根本无法弄清楚我们做错了什么,并且已经接近三天了。以下是我们从developers.facebook.com获得的代码:
I've been having a problem with a facebook like-box for a client, and me and a friend simply can't figure out what we're doing wrong, and it's been close to three days of staring at it. Here's the code we get from developers.facebook.com:
<div id="fb-root"></div>
<script>(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));</script>
<div class="fb-like-box" data-href="http://www.facebook.com/pages/mywebsite/11111111111"
data-width="280" data-colorscheme="dark" data-show-faces="true" data-stream="true" data-header="false"></div>
什么都没有出现。我们确实得到了这段代码,但它并没有按照我们想要的方式运行:
Nothing shows up. We did get this piece of code to work, but it doesn't quite work the way we want to:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like-box href="http://www.facebook.com/pages/mywebsite/1111111111" width="280" colorscheme="dark" show_faces="true" border_color="" stream="true" header="false"></fb:like-box>
您必须登录Facebook查看Feed,但客户希望它始终显示。
You have to log in to facebook to see the feed, but the client want it to always show up.
推荐答案
你需要在head脚本的第5行添加http:这样......
You need to add http: in line 5 of the head script like this...
js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1";
这是一个html5的东西。
its a html5 thing.
这篇关于Facebook Like Box不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!