类似Facebook的按钮是't工作
Facebook like button isn't working
我为我的实验编写了一个类似facebook的简单按钮,这样我就可以在我的应用程序中集成facebook功能:
这是代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Facebook and twitter log in</title>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '843995905631867',
xfbml : true,
version : 'v2.2'
});
};
(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 = "sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div
class="fb-like"
data-share="true"
data-width="450"
data-show-faces="true">
</div>
</body>
</html>
我收到了以下警告:
The "fb-root" div has not been created, auto-creating
fb:like failed to resize in 45s
我得到了一个空白屏幕。。。我哪里错了?
只需使用生成器获取正确的代码,它就会工作:https://developers.facebook.com/docs/plugins/like-button
您缺少一些东西,如url to like(data href)和fb根div(这并不重要,因为它将自动创建。
相关文章:
- Facebook登录按钮没有'不能在Firefox上工作
- Backbone/Facebook API未按预期工作
- Facebook scrollTo在iframe中不工作
- Facebook工作历史fql
- 让typescript与facebook登录为Angular 2项目工作
- 无法让 token.remove() 在 Facebook Emitter 中工作
- 试图让Facebook发射器工作
- Omniauth Facebook登录无法工作
- 如何获得Facebook Like Box"黑暗方案”;正确工作?(背景是透明的.)
- Facebook移动Safari无法正常工作
- Facebook自动登录JS在控制台中工作,但在GM脚本中不起作用
- Facebook自动收报机如何工作,例如在某些res或缩放它隐藏
- Facebook滚动条如何工作
- Facebook喜欢在Firefox中不可点击的按钮iframe实现,可以在其他浏览器中工作
- 如何使Facebook喜欢检测在我的网站上工作
- 类似Facebook的按钮是't工作
- jQuerys的draggable不工作包含在facebook页面上(基本理解)
- Facebook javascript sdk在没有ssl的情况下工作
- Facebook登录在浏览器中运行良好,但没有;我不能用phonegap在安卓系统上工作
- Facebook是如何做到的;的URL匹配算法工作