[英]Why am I able to see the x and y offset in the console but not on my webpage?
[英]Why am I not able to share my webpage link on Facebook?
该代码对我来说看起来不错,但是我不知道为什么它不显示FB弹出窗口并共享我的网站。
这是js部分
function streamPublish(name, description, hrefTitle, hrefLink, userPrompt){
FB.ui(
{
method: 'stream.publish',
message: '',
attachment: {
name: name,
caption: '',
description: (description),
href: hrefLink
},
action_links: [
{ text: hrefTitle, href: hrefLink }
],
user_prompt_message: userPrompt
},
function(response) {
});
}
function showStream(){
FB.api('/me', function(response) {
//console.log(response.id);
streamPublish(response.name, 'Connect with Abhishek Raj Simon on his new website http://abhisheksimion.cjb.net', 'hrefTitle', 'http://abhisheksimion.cjb.net', "Share abhisheksimion.cjb.net");
});
}
html
<a id="fbanchor" href="#" onclick="showStream(); return false;">Like it, Share it!</a>
有人可以指出,我要去哪里错了? 您可以访问在建网站http://abhisheksimion.cjb.net
我收到一个JavaScript错误:
错误:未定义showStream源文件: http ://users.cjb.net/abhisheksimion/行:1
我认为在您的脚本标记的第128行中,该fqlQuery()
括号应较高,以关闭fqlQuery()
函数。 如所写, showStream()
是fqlQuery()
函数的一部分,这会导致showStream()
失败。
如果您要做的只是添加基本的Facebook功能,例如“赞”和“分享”,则无需使用大量JavaScript即可实现。
https://developers.facebook.com/docs/reference/plugins/like/
https://www.facebook.com/sharer/sharer.php?yoursite.com
“ yoursite.com”是您要共享的网站。 您可以使用opengraph标记来指定内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.