Javascript Facebook自定义共享按钮未显示说明
我使用下面的JS代码在facebook上分享Javascript Facebook自定义共享按钮未显示说明,javascript,facebook-opengraph,facebook-sharer,Javascript,Facebook Opengraph,Facebook Sharer,我使用下面的JS代码在facebook上分享 function openFbPopUp() { var fburl = 'http://54.251.121.6/cnc/cupcakes-n-chai-side-table'; var fbimgurl = 'http://imageURL'; var fbtitle = 'Your title'; var fbsummary = "This is the description blah blah blah";
function openFbPopUp() {
var fburl = 'http://54.251.121.6/cnc/cupcakes-n-chai-side-table';
var fbimgurl = 'http://imageURL';
var fbtitle = 'Your title';
var fbsummary = "This is the description blah blah blah";
var sharerURL = "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + encodeURI(fburl) + "&p[images][0]=" + encodeURI(fbimgurl) + "&p[title]=" + encodeURI(fbtitle) + "&p[summary]=" + encodeURI(fbsummary);
window.open(
sharerURL,
'facebook-share-dialog',
'width=626,height=436');
return false;
}
在弹出窗口中,描述文本看起来很好。但当在facebook上看到时,这种描述并没有出现
共享时,可以看到描述摘要文本。
但描述摘要文本没有显示在facebook上
function openFbPopUp() {
var fburl = 'http://54.251.121.6/cnc/cupcakes-n-chai-side-table';
var fbimgurl = 'http://imageURL';
var fbtitle = 'Your title';
var fbsummary = "This is the description blah blah blah";
var sharerURL = "http://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + encodeURI(fburl) + "&p[images][0]=" + encodeURI(fbimgurl) + "&p[title]=" + encodeURI(fbtitle) + "&p[summary]=" + encodeURI(fbsummary);
window.open(
sharerURL,
'facebook-share-dialog',
'width=626,height=436');
return false;
}
在您共享的任何页面上,尝试放置以下内容:
<meta property="fb:app_id" content="{Your_App_ID}"/>
<meta property="og:url" content="http://54.251.121.6/cnc/cupcakes-n-chai-side-table"/>
<meta property="og:title" content="Your title"/>
<meta property="og:image" content="http://imageURL"/>
<meta property="og:description" content="This is the description blah blah blah">
FB.ui({
method: 'feed',
name: 'Your title',
link: 'http://54.251.121.6/cnc/cupcakes-n-chai-side-table',
picture: 'http://imageURL',
caption: '',
description: 'This is the description blah blah blah',
ref: '{your_reference_call_here}'
});
我个人的经验表明,使用JSSDK共享内容比使用URL重定向方法更安全,不会出现错误 谢谢@Aashish Tripathee。我不能使用meta-description标记,因为有些页面在页面的不同块上需要3-4个不同的meta-description标记。然后尝试使用JS SDK。在您的案例中,当涉及到要共享的多个内容时,这肯定是有效的,而且非常好