我已经阅读了有关Facebook Like小部件问题的各种线索,但是我仍然无法在任何浏览器中显示它。
我通过Facebook拥有的调试工具运行了我的网站,我只收到一个关于og:locale属性的警告,我认为这不会导致问题。
请参阅下面的简单html,有人可以帮忙吗?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
</head>
<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_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<h1>New Web Project Page</h1>
<div class="fb-like" data-href="http://www.facebook.com/pages/myGFC/" data-send="false" data-width="450" data-show-faces="false" data-font="lucida grande">Text here</div>
</body>
</html>
答案 0 :(得分:1)
试试这个代码段:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>New Web Project</title>
</head>
<body>
<div>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F
%2Flyndonreid.com
%2Fcontact&layout=standard&show_faces=true&width=450&action
=like&colorscheme=light" scrolling="no" frameborder="0"
allowTransparency="true" style="border:none; overflow:hidden; width:450px;
height:px"></iframe>
</div>
</body>
</html>