Jakby ktoś chciał to gotowiec:
<script src="~/Scripts/jquery-1.10.2.min.js" type="text/javascript"></script>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function () {
FB.init({
appId: 'app_ID', status: true, cookie: true,
xfbml: true
});
};
(function () {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<script type="text/javascript">
$(document).ready(function () {
$('#share_button').click(function (e) {
e.preventDefault();
FB.ui(
{
method: 'feed',
name: 'This is the content of the "name" field.',
link: 'http://localhost:53650/Home/Index',
picture: '<adres_fotki>',
caption: 'Top 3 reasons why you should care about your finance',
description: 'What happens when you dont take care of your financexpayers…',
message: ''
});
});
});
</script>
<img src="~/Content/share_facebook.png" id="share_button">
</p>