开发者

Facebook and sharing

how to share some link with description? I found th开发者_运维问答e way of passing title&url through meta-tags, but what about a short description?


Do you mean Open Graph meta tags? description is a meta tag just like title and url.

<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


You can use facebook ui:

Here is example:

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: ''
       }
    );
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜