欢迎光临景诺科技软件开发淘宝店

进店请收藏,谢谢

各大社交网站添加关注功能API

facebook 是赞: 只要赞了就关注了
实现有下面三种:

http://developers.facebook.com/docs/reference/plugins/like/

//1 html5方式
<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/zh_CN/all.js#xfbml=1&appId=246398722099129";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like" data-href="http://www.facebook.com/CityofSteam" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>


//2URL方式
<a href="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2FCityofSteam&send=false&layout=button_count&width=450&show_faces=false&action=like&colorscheme=light&font&height=21&appId=246398722099129" target="_blank">like a</a> 


//3 iframe

<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2FCityofSteam&amp;send=false&amp;layout=button_count&amp;width=400&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21&amp;appId=246398722099129" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height:21px;" allowTransparency="true"></iframe>

谷歌+:

http://developers.google.com/+/plugins/+1button/?hl=zh-CN

<!-- Place this tag in your head or just before your close body tag. -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

<!-- Place this tag where you want the +1 button to render. -->
<g:plusone href="https://plus.google.com/105160512834346709478"></g:plusone>

twitter:

https://dev.twitter.com/docs/follow-button

//1. html5
<a href="https://twitter.com/cityofsteam" class="twitter-follow-button" data-show-count="false" data-lang="en">Follow @cityofsteam</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

//2 iframe
<iframe allowtransparency="true" frameborder="0" scrolling="no"
  src="//platform.twitter.com/widgets/follow_button.html?screen_name=cityofsteam"
  style="width:300px; height:20px;"></iframe>

更多

本文固定链接: http://shanmao.me/web/ge-da-jiao-wang-zhan-tian-jia-guan-zhu-gong-neng-api | 山猫的博客

该日志由 admin 于2012年11月07日发表在 网页前端 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: 各大社交网站添加关注功能API | 山猫的博客
关键字: