是的,我在http://www.WasupPalmSprings.com上的 IE 中工作。如果您从主页单击任何故事,底部会有一个“赞”按钮,显示 IE 中的评论框。
我遇到了评论框未在其他网站的 IE 中显示的问题。这是我使用的清单:
- 确保您在页面的 HTML 标记中具有正确的 xmlns 属性。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 过渡//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http ://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">
确保您的页面上有 <div id="fb-root"></div> 。
确保您已经为您的网页设置了一个应用程序,因为您需要一个应用程序 ID。如果您没有应用程序,请在此处创建一个:http://www.facebook.com/developers/
使用 javascript 加载 Facebook 连接 javascript 文件。不要只在页面上放置 <script src="..."> 标记。如果您使用 jquery 或类似的,理想情况下这将进入 onReady 处理程序。否则,将其放在页面底部的 <script> 标记中。
请务必从您创建的 Facebook 应用程序中替换您的实际应用程序 ID,其中显示“在此处插入您的应用程序 ID”
window.fbAsyncInit = function() {
FB.init({appId: 'INSERT YOUR APP ID HERE', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
为您的页面添加带有开放图形信息的元标记。<meta property="og:title" content="YOUR PAGE TITLE HERE"/> <meta property="og:site_name" content="YOUR WEBSITE NAME HERE"/> <meta property="og:type" content=" website"/> <meta property="og:url" content="URL OF PAGE HERE"/> <meta property="og:image" content="URL OF IMAGE YOU WANT TO SHARE"/> <meta property=" og:description" content="YOUR PAGE DESCRIPTION HERE"/> <meta property="fb:app_id" content="YOUR FB APP ID HERE"/>
最后,在页面上您希望它出现的任何位置添加“赞”按钮。请务必替换您自己的页面 URL。
<fb:like href="INSERT YOUR PAGE URL HERE" layout="button_count" show_faces="false" width="570" font="arial"></fb:like>