Add a Facebook "Like" button to your blog
April 26, 2010 4:47 pmYou 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='http://www.facebook.com/plugins/like.php?href="; url=location.href; buttoncode = buttoncode + url + "&layout=standard&show_faces=true&width=250&action=like&colorscheme=light' scrolling='no' frameborder='0' allowtransparency='true' style='border:none; overflow:hidden; width:250px; height:px'></iframe>"; document.write(buttoncode); </script>
Hopefully that will work, I’m not much of a coder so if it doesn’t work I probably can’t fix it 🙁
Tags: Facebook like buttonCategorised in: internet marketing
This post was written by David