我希望我的网页上的 Like 按钮能够像这里的那样呈现,它在评论框下方显示图像、标题和描述。我已经包含了必要的开放图标签,但是 Like 框只是基本的、开箱即用的标签,没有任何额外的开放图信息。这是我的代码,如您所见,我已经编辑了我的 FB 应用程序 ID,但除此之外,这就是我正在运行的代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="facebook" class="no_js" xmlns:fb="http://ogp.me/ns/fb#" xmlns:og="http://ogp.me/ns#">
<head>
<title>Facebook Test Page</title>
<link ref="canonical" href="http://localhost/Fbtest.jsp" />
<meta property="fb:app_id" content="<REDACTED>" />
<meta property="og:title" content="Facebook Test Page" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://localhost/Fbtest.jsp" />
<meta property="og:image" content="http://localhost/images/my_family.png" />
<meta property="og:site_name" content="My Website" />
<meta property="og:description" content="This is just a test page, for Facebook integration." />
</head>
<body>
<div id="fb-root"><!-- The JS SDK requires the fb-root element in order to load properly. --></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: '<REDACTED>', status: true, cookie: true, xfbml: true});
};
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script>
<h1>Facebook Test Page</h1>
<p>Here is a picture of my family. This is just a test, for Facebook integration.</p>
<img alt="My family" src="http://localhost/images/my_family.png"/>
<p/>
<fb:like></fb:like>
</body>
我在 Windows 7/Intel 笔记本电脑上的 JBoss 5.1 上运行它,并且同时使用 IE9 和 Firefix 网络浏览器。
我感谢您的帮助!