Sunday, January 20, 2013

Facebook Like Boxes

Did you know that you can show who liked you on Facebook with a simple widget called the "like box?" Unfortunately, this is only available for Facebook Pages, which really sucks. All you need to do is enter some data at http://developers.facebook.com/docs/reference/plugins/like-box/ and click get code. Make sure the FB Javascript SDK is included:

<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>
Then you have the code they generated for you:
<div class="fb-like-box" data-href="http://www.facebook.com/pages/Fireburst/269394286467409?ref=hl" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>

No comments:

Post a Comment

Feel free to comment. Keep it nice, polite and on topic. You may link to a site if it contains content relates to the content of whatever post you are commenting on. You may link to a site that only uses, for example, HTML5 video. Remember, on topic!