就像盒子代码不起作用
页面: http://www.facebook.com/Travel.by.Design
代码:
<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/travel.by.design" width="292" show_faces="true" stream="true" header="false" css="<?php bloginfo('stylesheet_directory'); ?>/fbstyle.css?1"></fb:like-box>
在同一个网站上,我们安装了更多 Like Boxes,它们都使用相同的代码(只是不同的 URL)。所以我认为它一定与特定的 URL 其他代码有关
,相同的网站可以工作:
<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/farmeadow" width="292" show_faces="true" stream="true" header="false" css="<?php bloginfo('stylesheet_directory'); ?>/fbstyle.css?1"></fb:like-box>
Page: http://www.facebook.com/Travel.by.Design
Code:
<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/travel.by.design" width="292" show_faces="true" stream="true" header="false" css="<?php bloginfo('stylesheet_directory'); ?>/fbstyle.css?1"></fb:like-box>
website: http://waldhaus.com
On same website we have more Like Boxes installed and they all work with same code ( just different URL's). So I assume it must have to do with specific URL
other code, same website works:
<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/farmeadow" width="292" show_faces="true" stream="true" header="false" css="<?php bloginfo('stylesheet_directory'); ?>/fbstyle.css?1"></fb:like-box>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有 8 个不同的
div
元素,其id
为fb-root
。浏览器无法决定使用哪一个。您只需要页面上带有
fb-root
的div
之一。您应该始终在任何元素的
id
属性中拥有唯一的值。正如您在上面的评论中所述,您收到的错误是 -
浏览器不知道要锁定哪个
fb-root
元素。You have 8 different
div
elements with anid
offb-root
.The browser can not decide which one to use. You only need one of
div
withfb-root
on your page.You should always have unique values in the
id
property of any element.As you have stated from the comments above, the error you are getting is -
The browser doesn't know what
fb-root
element to latch onto.