About Me

Narendran C R
London, UK
Follow me
Linkedin Facebook Twitter Youtube Blogspot

Saturday, February 19, 2011

Dynamic Facebook Like Button

Recently, some of my friends was asking the simplest way to automatically fetch the url of the current page for Like button. Though this can be done using serverside scripts, the simplest way would be to include it using the javascript. All you need is a javascript file which writes an iframe like button with dynamic url and include that in the html using script tag. Below is the simple example!

Javascript - facebookshare.js
document.write('<iframe scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowtransparency="true" src="' + escape(location.href) + '&layout=button_count&show_faces=true&width=100&action=like&font=segoe+ui&colorscheme=light&height=21"></iframe>')


<title>Facebook Like Button Test</title>
    <script type="text/javascript" src="facebookshare.js"></script>

Monday, February 07, 2011

Natgeotv Webisodes Lauch

We recently launched a website called webisodes. It is just an other section of Natgeotv but the content is stunning. I love the short videos, all interesting and informative. Check it out!