Wednesday, June 23, 2010

FaceBook Javascript SDK Like button examples

<h1>Defaults</h1>
<fb:like></fb:like>

<h1>Explicit href</h1>
<fb:like href="http://fbrell.com"></fb:like>

<h1>Custom Font</h1>
<fb:like font="trebuchet ms" href="http://fbrell.com"></fb:like>

<h1>Disable Faces</h1>
<fb:like show_faces="no" href="http://fbrell.com"></fb:like>

<h1>Button Count</h1>
<fb:like layout="button_count" href="http://fbrell.com"></fb:like>

<h1>Narrow</h1>
<fb:like width="200" href="http://fbrell.com"></fb:like>

<h1>Narrow no faces</h1>
<fb:like width="200" show_faces="no" href="http://fbrell.com"></fb:like>

<h1>Recommend</h1>
<fb:like href="http://fbrell.com"></fb:like>

<h1>Dark</h1>
<div style="background-color: black; padding: 10px;">
<fb:like colorscheme="dark" href="http://fbrell.com"></fb:like>
</div>

<h1>Dark Button SuscribeCount</h1>
<fb:like layout="button_count" colorscheme="dark" href="http://fbrell.com"></fb:like>

To Subscribe the likes

<script>
// this will fire when any of the like widgets are "liked" by the user
FB.Event.subscribe('edge.create', function(href, widget) {
Log.info('You liked ' + href, widget);
});
</script>


Source: http://developers.facebook.com/tools/console/ -> examples

No comments: