Created
November 9, 2011 01:10
-
-
Save andershaig/1349982 to your computer and use it in GitHub Desktop.
Facebook Post to Wall w/ Variable Share Link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
jQuery(document).bind('afterfbinit', function () { | |
// The ID of your share button or link | |
$('#share_button').live('click', function () { | |
FB.ui({ | |
method: 'feed', | |
name: 'Title of Share Info', | |
description: 'Description under title in Share Info', | |
picture: 'Link to an image (90 by 90px)', | |
link: 'http://www.facebook.com/pages/@/{{ fb.page.id }}' | |
}, function (param) { | |
// If they cancel params will show: | |
// {action:false, ...} | |
// and if they send the friend request it'll have: | |
// {action:true, ...} | |
// and if they closed the pop-up window then: | |
// param is undefined | |
}); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment