Skip to content

Instantly share code, notes, and snippets.

@DavidQL
Created January 7, 2011 19:55
Show Gist options
  • Save DavidQL/770006 to your computer and use it in GitHub Desktop.
Save DavidQL/770006 to your computer and use it in GitHub Desktop.
// Build and inject Like button
$('ul.posts a').each(function() {
var fb_url = location.href.split('/')[0] + '//' + location.href.split('/')[2] + $(this).attr('href'),
fb_like = '<div class="fb_recommend"><fb:like href="'+fb_url+'" layout="standard" show_faces="false" action="recommend" colorscheme="light"></fb:like></div>';
$(this).parent().next().after(fb_like);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment