The Facebook Like button has become very popular with the recent release of the Open Graph API. This plugin allows you to add the Facebook Like button to any website and use all of the options associated with the Facebook Like API and JavaScript SDK.
Features:
- Can add meta data to your pages to be included on Facebook
- If already logged in, will allow you post favorites to site – if not logged in, will prompt you to log in.
- Works with all FB Like options
Demonstration:
- Facebook Like Demo
- Or just look at the top of this post, you will see a Like Button – which is being added by this plugin.
Requirements:
- jQuery – Compatible up to 1.4.1
- Facebook Application ID – Get one here.
- Its important that you put the plugin and function at the bottom of your page.
Download:
How it Works:
Once the script has been setup on the page, it will automagically pull in the page URL and page Title – and allow you to like on on facebook. If your friends also like it, you will see their names/faces show up. If you are not logged in, you will only see the number of people who like it and if you click “like” – it will prompt you to login.
Code Example:
<script type="text/javascript" src="../js/jquery.onefblikev1.0.js"></script>
<div id="fb-like-example"></div>
$(document).ready(function () {
$('#fb-like-example').oneFBLike({appID:'XXXXXXXXXXXXXXX'});
});
Options:
The following options can be passed into the plugin and if they are not, the default values below will be shown:
appID: 'XXXXXXXXXXXXXXX', // This is mandatory, if you dont enter a Facebook Application ID - the plugin will not work siteTitle: ' ', // Optional Meta siteName: ' ', // Optional Meta siteImage: ' ', buttonWidth: 450, buttonHeight: 80, showfaces: true, font: 'lucida grande', layout: 'normal', action: 'like', colorscheme: 'light'
Useful Resources:
Category Open Source, jQuery
You can follow any responses to this entry through the RSS 2.0 feed.





@invocoes
June 30th, 2010 at 3:02 pm
Got to implement this one very soon :) I do not like that iframe stuff
jrutter
June 30th, 2010 at 10:50 pm
Yes, I didnt like the iframe option either – their JavaScript SDK is actually very slick!
Michael Pehl
July 20th, 2010 at 7:35 am
Implementing it! I like that one, good work and thanks for sharing :-)
MissScript
July 30th, 2010 at 2:08 am
I had implemented this in the right section of my webpage, but content of the meta tags is not loaded(If I like my page then on Facebook will appear the same info that exists in Linter, not the one that I changed using customized OpenGraph tags)…. Please help me.
jrutter
August 1st, 2010 at 12:57 pm
Can you post your code? Thanks.
Moonwalker
August 22nd, 2010 at 12:23 am
Sick!
Thanks a lot for this!
Just a question if possible:
Is it possible to change the language? It’s in English right now, but I’m planning to make a multilingual website, that’s why I’m curious. :)
Thanks again for the great script!