The easiest way to add Facebook share button would be to visit http://www.facebook.com/share_partners.php and copy the code and paste it in your webpage after replacing the text "url" with the actual URL of the page you want to share. If it is dynamic content, you can use the variable or object name.
<script>function fbs_click()
{u=location.href;t=document.title;window.open
('http://www.facebook.com/sharer.php?u='+
encodeURIComponent(u)+'&t='+encodeURIComponent(t),
'sharer','toolbar=0,status=0,width=6
26,height=436');return false;}</script>
The problem I faced with the above approach is that I wanted to modify a widget to add Facebook share in place of another button, say the button associated with furl. But in this case we are creating a separate share on Facebook button and not modifying the widget. So we will take a look at the alternative technique.
From the above snippet we know that we have to access Facebook Web API to share the link on it. So what I would do is display a facebook icon and pass the URL I want to save to http://www.facebook.com/share.php?
<a href='http://www.facebook.com/share.php?u=http://www.mindfiresolutions.com'>
<img alt='Facebook'src='http://i591.photobucket.com/albums/ss358
/danishctc/blogres/fbook24.jpg'/></a>
Now let us implement the code given above...Click on the Facebook icon to see how it works;)