0

我一直在尝试使用以下代码将 Pinterest 的发送消息复制给用户:

    FB.ui({
    method: 'send',
    name: 'The Image',
    display: 'popup',
    description: 'Description here',
    link: 'http://www.mywebsite.com/',
});

弹出框出现了,但我无法控制描述、名称或显示用户缩略图的图片。

弹出框显示我网站的描述、名称和页面中的随机图像。

这是一张图片http://postimg.org/image/8o01c3vfr/

如何获得弹出窗口以显示用户缩略图和自定义描述和名称?

更新:我试过了,但仍然没有希望!

<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
<meta property="fb:app_id" content="app id" /> 
<meta property="og:title" content="Your title">
<meta property="og:description" content="Your Desc.">
<meta property="og:image" content="http://2.bp.blogspot.com/-Z-yBlXMMYWo/UBUYe-Lc46I/AAAAAAAAAxc/VO9XB7Ls-sY/s640/Under+water.JPG">
<meta property="og:image:secure_url" content="http://2.bp.blogspot.com/-Z-yBlXMMYWo/UBUYe-Lc46I/AAAAAAAAAxc/VO9XB7Ls-sY/s640/Under+water.JPG">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="150">
<meta property="og:image:height" content="150">
</head>
<body>

<div id='fb-root'></div>

<script>
  // Load the SDK asynchronously
  (function(d, s, id){
     var js, fjs = d.getElementsByTagName(s)[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement(s); js.id = id;
     js.src = "https://connect.facebook.net/en_US/all.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

window.fbAsyncInit = function() {
    FB.init({appId: "app id", status: true, cookie: true, xfbml: true,   frictionlessRequests : true});

};

function send_message() {
    FB.ui({
        method: 'send',
        name: 'The Image',
        display: 'popup',
        description: 'Description here',
        link: 'http://www.website.com/',
        picture: 'http://www.website.com/image.png'
    });
}
</script>
<a href='#' onclick='send_message();'>send</a>

</body>
</html>
4

1 回答 1

0

尝试在您的<head></head>块中使用开放图元标记:

<meta property="og:title" content="Your title">
<meta property="og:description" content="Your Desc.">
<meta property="og:image" content="http://YOURWEBSITE.com/YOURIMAGE.png">
<meta property="og:image:secure_url" content="https://YOURWEBSITE.com/YOURIMAGE.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="150">
<meta property="og:image:height" content="150">
于 2013-07-25T04:19:06.197 回答