Created
March 26, 2014 12:21
-
-
Save niraj-shah/9781909 to your computer and use it in GitHub Desktop.
Adding action links to posts using JavaScript and the FB.UI Feed dialog.
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
<div class="well"> | |
<button class="btn btn-info share-btn">Share</button> | |
</div> | |
<script type="text/javascript"> | |
function fb_share() { | |
FB.ui( { | |
method: 'feed', | |
name: "Search Google", | |
link: "https://www.google.com", | |
picture: "https://www.google.co.uk/images/srpr/logo11w.png", | |
caption: "The world's most popular search engine", | |
actions: {"name":"Search", "link":"http://www.google.com"} | |
}, function( response ) { | |
// do nothing | |
} ); | |
} | |
$(document).ready(function(){ | |
$('button.share-btn').on( 'click', fb_share ); | |
}); | |
</script> |
some Facebook api options for Feed have been deprecated and will not be supported anymore
See this:
https://developers.facebook.com/docs/sharing/reference/feed-dialog#deprecated-params
Use This:
http://www.fbrell.com/Sharing/2%20-%20FB.ui%20Dialogs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please Help me...
When i share content in my mobile using facebook app the incorrect content share. but when i use to mobile browser it show correct content...