3
votes

The Like button lets a user share your content with friends on Facebook. When the user clicks the Like button on your site, a story appears in the user's friends' News Feed with a link back to your website., right?

i write following code, this it's just like LIKE button, i am not able to share any content of site to fb wall page

<script type="text/javascript">
    function renderFbLike() {
        var parent = document.getElementById('fblikediv');
        var child = document.getElementById('fblikeimg');
        parent.removeChild(child);

        var html2 = "<iframe src=\"http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2FVoicent&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=60&appId=258346014244946\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:40px;\" allowTransparency=\"true\"></iframe>";
            document.getElementById('fblikediv').innerHTML = html2;
    }
</script>

</head>

<body>
<div id="fblikediv"><img src="images/fb-like-button.png" id="fblikeimg" onMouseOver="return renderFbLike();"></div> 
3

3 Answers

4
votes

go to this http://developers.facebook.com/docs/reference/plugins/like/ page and when you enter the parameters you want facebook generates the html and javascript codes for your page. when you implement those to your page, it works

1
votes

if you want to add any social plugin you dont need any SDK's for C# because FB social is a just HTML and Js its works independently C# sdk only need if you want to build Application for facebook or any other stuff like login button etc..

0
votes

Facebook restrict Like functionality and view of Like button in Terms and Conditions, so the only way to get Like button on your website is to use Like button from Facebook as Mutu said: http://developers.facebook.com/docs/reference/plugins/like/ If you don't need exactly Likes, you can use Share functionality which allows to customize element look by using Javascript API: https://developers.facebook.com/docs/reference/dialogs/send/