添加Facebook的“赞"按钮 [英] Adding a facebook Like button

查看:75
本文介绍了添加Facebook的“赞"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人可以帮我解决这个问题:我尝试使用HTML5之类的facebook之类的按钮插件代码生成器,但无法显示该按钮.这是我的代码(我只想尝试页面上的按钮),而我们的网站已被Google取代:

I was hoping someone could help me with this: I tried the facebook like button plugin code generator for HTML5, and I can't get the button to display. Here is my code (I'm down to trying just the button on the page), with our website replaced with google:

<!doctype html>
<html>
<head>
</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_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like" data-href="http://www.google.com" data-send="false" data-width="450" data-show-faces="true"></div>

</body>
</html>

我想念什么?谢谢.

推荐答案

尝试以下代码:

<div id="fb-root"></div>
<script src="//connect.facebook.net/en_US/all.js"></script>

<fb:like href="http://www.google.com" send="false" width="75" height="20" show_faces="false" layout="button_count"></fb:like>

这篇关于添加Facebook的“赞"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆