Add a Facebook "Like" button to your blog

April 26, 2010 4:47 pm Published by

You may have noticed that I’ve added a Facebook “like” button to this blog to allow visitors to share posts with their friends. While you can get code from Facebook, it doesn’t update the URL dynamically, so I decided to dip into Javascript and write some code to do it instead.

Being a generous kind of chap you can copy and paste it from here:

<script language="JavaScript">
buttoncode = "<iframe src='";
buttoncode = buttoncode + url + "&amp;layout=standard&amp;show_faces=true&amp;width=250&amp;action=like&amp;colorscheme=light' scrolling='no' frameborder='0' allowtransparency='true' style='border:none; overflow:hidden; width:250px; height:px'></iframe>";

Hopefully that will work, I’m not much of a coder so if it doesn’t work I probably can’t fix it 🙁


Categorised in:

This post was written by David