我想在FB上分享一张图片(作为普通帖子),上面有一些标题我用它来分享
<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({ appId: '660612734042393', status: true, cookie: true, xfbml: true, oauth: true });
function postToWall() {
FB.login(function(response) {
if (response.authResponse) {
FB.ui({
method: 'feed',
picture: 'http://searchengineland.com/figz/wp-content/seloads/2015/10/google-panda-name3-ss-1920-800x450.jpg',
caption: 'Checkout the image ',
description: 'Checkout the image Checkout the image Checkout the image .'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
});
} else {
//alert('User cancelled login or did not fully authorize.');
}
}, {scope: 'publish_actions,email'});
return false;
}
<a href="#" onclick="return postToWall();"><img type="button" src="../img2/shareFb.png"style="width: 109px;height: 50px;" ></a>
这会像链接一样被共享,而不是像我们在FB上那样分享这个图像像普通的图像一样
我已经检查了FB sdk,但没有找到确切的解决方案。 任何帮助将不胜感激