我目前在Facebook按钮上分享了以下代码:
<script>
function fbShare(url, title, descr, image, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2)-100;
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open('http://www.facebook.com/sharer.php?s=100&p[title]=' + title + '&p[summary]=' + descr + '&p[url]=' + url + '&p[images][0]=' + image, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight+'' );
}
</script>
<a href="javascript:fbShare('http://www.mywebsite.co', 'Fb Share', 'Facebook share popup', '', 520, 350)"><img class="right2" src="fblogo2.png"></a>
这很好用但是Facebook选择从网站分享的图像是随机选择的。我希望能够指定一个。无论如何这样做?
答案 0 :(得分:1)
是。您可以将facebook元标记添加到特定页面:
<meta property="og:image" content="http://graphics.myfavnews.com/images/logo-100x100.jpg" />
这是Facebook在您分享该页面时将使用的内容。