I am working on share functionality using Facebook
. The login functionality is working fine. But when I try to share something using a sample code, it is showing like
Sorry, something went wrong.
We’re working on getting this fixed as soon as we can.
The code I am using is
$('#fb_test').on('click', function(e){
e.preventDefault();
FB.ui(
{
method: 'feed',
name: 'This is the content of the "name" field.',
link: 'URL which you would like to share ',
picture: "URL of the image which is going to appear as thumbnail image in share dialogbox",
caption: 'Caption like which appear as title of the dialog box',
description: 'Small description of the post',
message: ''
}
);
});
2
Answers
Use this code instead of yours this will works fine.
First reference this fb script after the body tag
then call this method on your
<a>
click:This will work for you 🙂
It seems like this error can happen for any number of reasons, and they don’t tell you what the problem is.
In my case, I omitted the # from the hashtag field, which is apparently cause for total failure.