简体   繁体   English

Javascript Facebook SDK

[英]Javascript Facebook SDK

I am using JavaScript Facebook SDK for sharing my post on Facebook. 我正在使用JavaScript Facebook SDK共享我在Facebook上的帖子。 I am trying to share a link " http://www.google.com " through my post. 我正在尝试通过我的帖子分享一个链接“ http://www.google.com ”。 For that I am using "properties" field that Facebook JavaScript SDK provides. 为此,我正在使用Facebook JavaScript SDK提供的“属性”字段。

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. 每当我尝试发布内容时,Facebook都会在预览中显示该链接,但是在Facebook墙上共享该帖子时,相同的链接是不可见的。

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.. 在发布到Facebook墙之前。

在此处输入图片说明

After posting to facebook wall.... 在张贴到Facebook墙后。

在此处输入图片说明

Most likely html tags aren't allowed in the description field. description字段中最可能不允许使用html标签。 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? 但是值得尝试转义双引号(\\“)。您是否使用firebug / dev工具检查器查看了该链接的html?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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