Sharing your content with Share button is absolutely simple. In my case I did it like this for a button i have in my html with id sharebuttonfacebook
$("#sharebuttonfacebook").click(function() {
var msg = "Hi This is my wonderful website";
FB.ui({method: 'feed',
name: 'MCQ Nation ',
link: 'http://www.mcqnation.com/Trail3/pyramid.php?..dyanmic stuff..' ,
picture: 'http://www.mcqnation.com/Trail3/fbapp2.png',
caption:'CLICK ON THE IMAGE TO GO TO OUR WEBSITE',
description: msg ,
message: 'AAA'});
return false;
});
In addition to this you need to register an app.
Nothing could be simpler.
Just go to http://www.facebook.com/developers/app
and register your new app.
They will give you a simple code that has to be put just after the body which goes like -
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID', // App ID
channelUrl : 'CHANNEL FILE LOCATION', // Channel File This file has just one line which you will find at facebook developers
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
</script>
With these two things in place you can Decide what to share on facebook.
Also in the function we have made above you can substitute whatever variables you like hence make it dynamic. Hope this answers your Question.
PS: If it could get better than this you dont need any permission from the user!