facebook 是赞: 只要赞了就关注了
实现有下面三种:
http://developers.facebook.com/docs/reference/plugins/like/
[code]
//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&send=false&layout=button_count&width=400&show_faces=false&action=like&colorscheme=light&font&height=21&appId=246398722099129" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:400px; height:21px;" allowTransparency="true"></iframe>
[/code]
谷歌+:
http://developers.google.com/+/plugins/+1button/?hl=zh-CN
[code]
<!– 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>
[/code]
twitter:
https://dev.twitter.com/docs/follow-button
[code]
//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>
[/code]