简体   繁体   中英

Javascript Facebook SDK

I am using JavaScript Facebook SDK for sharing my post on Facebook. I am trying to share a link " http://www.google.com " through my post. For that I am using "properties" field that Facebook JavaScript SDK provides.

Whenever I try to post something, Facebook displays the link in a preview, however the same link is not visible when the post is shared on Facebook wall.

Below is the code which I am using

var p = {
  "Look at details": {
    "text": "here",
    "href": "http://www.google.com"
  }
};

FB.ui({
  method: 'feed',
  name: 'Los Angeles, CA, United States',
             caption: 'The current condition for Los Angeles is Fair.',
             description: 'Temperature is 58&deg;F.\nLook at details: <a href="www.google.com">here</a>',
             link: 'www.google.com',
             properties: p
}, function(response){});

Before posting to facebook wall..

在此处输入图片说明

After posting to facebook wall....

在此处输入图片说明

Most likely html tags aren't allowed in the description field. But it's worth a try to escape the double quotes (\\"). Have you looked at the html of that link using firebug/dev tools inspector?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM