如何通过Facebook分享一个div或html页面的一部分?

时间:2014-07-24 17:54:17

标签: jquery html facebook facebook-graph-api facebook-javascript-sdk

嗨我知道过去曾多次询问过这个问题,但由于FB改变了SDK在Javascript中的工作方式,我想这个问题又回来了。

我有一个html页面,我需要允许用户使用Facebook共享按钮在Facebook中共享页面的某些部分(div或图像)。

根据2013年(here)给出的一些答案,似乎可以定制FB.ui函数。我试过了,但没用。仅显示了我的html页面中的元标记。

我从Facebook开发人员文档中了解到,SDK只会抓取html页面中的元标记(我有待纠正)。我不能将我希望用户分享的部分放在元标记中,因为部分会根据用户的交互而变化。

我感谢任何建议。感谢。

我找到并尝试但失败的FB.ui代码:

FB.ui(
{
    method: "feed",
    name: "testing",
    link: "put a url here",
    picture: "put a jpg file here",
    caption: "testing",
    description: put in the class of a div here,
    message: put in the class of another div here
}); 

0 个答案:

没有答案