Facebook和分享

时间:2011-10-07 16:04:57

标签: javascript facebook

如何与描述分享一些链接?我找到了通过元标记传递title& url的方法,但是简短说明呢?

2 个答案:

答案 0 :(得分:2)

您的意思是Open Graph元标记吗? description是一个元标记,就像titleurl一样。

<meta property="og:description"
          content="A group of U.S. Marines, under command of
                   a renegade general, take over Alcatraz and
                   threaten San Francisco Bay with biological
                   weapons."/>

Open Graph Protocol documentation

答案 1 :(得分:0)

您可以使用facebook ui

以下是示例:

function share() {
    url = "http://some.url.com";
    FB.ui({
        method: 'stream.publish',
        message : '',
        display: 'popup',
        attachment: {
            name: 'some title',
            href: url,
            description: 'Some description',
            media: [{'type':'image', 'src': "http://some.site.com/link/to/thumbail.jpg", href: url }]
        },
        user_message_prompt: ''
       }
    );
}