FB 图形未加载?
我试图简单地将“赞”按钮添加到我的简单网站中,但我根本没有得到任何图形。我去了 AddThis,他们的实现也不起作用。是我的系统设置不正确还是我犯了菜鸟错误。这是代码,我得到的只是一个带有该段落的红色框。 感谢您的帮助!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml: lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>Facebook button test</title>
</head>
<body>
<style type="text/css">
.content p {
border: 1px solid red;
position: relative;
}
.fb-root {
border: 3px solid blue;
height: 200px;
width: 500px;
padding: 1em;
float: right;
}
.fb-like {
border: 10px solid green;
padding: 1em;
}
</style>
<div class="content">
<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>
<fb:like href="facebook.com/burgessfww" send="true" layout="button_count" width="450" show_faces="false"></fb:like>
<p> Some text to take up some space and see what's happening!</p>
</div>
</body>
</html>
I am trying to simply add the like button to my simple website and I don't get any graphics at all. I went to AddThis and their implementation doesn't work either. Is my system not setup correctly or am I making a rookie mistake. Here is the code and all I get is a red box with the paragraph.
Thanks for any help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml: lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>Facebook button test</title>
</head>
<body>
<style type="text/css">
.content p {
border: 1px solid red;
position: relative;
}
.fb-root {
border: 3px solid blue;
height: 200px;
width: 500px;
padding: 1em;
float: right;
}
.fb-like {
border: 10px solid green;
padding: 1em;
}
</style>
<div class="content">
<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>
<fb:like href="facebook.com/burgessfww" send="true" layout="button_count" width="450" show_faces="false"></fb:like>
<p> Some text to take up some space and see what's happening!</p>
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题很简单......但由于我没有测试它你应该!
这似乎是你的错误: XMLNS:FB 两次
xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:fb="http://ogp.me/ns/fb#"
更改它至
xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns/fb#"
致以诚挚的问候
I think the problem is simple... but since I didn't test it You should!
This seems to be your mistake: XMLNS:FB twice
xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:fb="http://ogp.me/ns/fb#"
change it to
xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns/fb#"
best regards