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: ''
}
);
}
精彩评论