dtwxt88240 2014-01-02 08:40
浏览 44

我想要一个分享用户时间线特定数据的Facebook分享按钮?

I am new to working with facebook APIs, but i want a facebook share button on my website which share that specific data on user's timeline after log in to facebook. I have already read some documents on that and make a page for testing purpose on my localhost. But there is a problem the page is,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Untitled Document</title>
</head>

<script>
function fbs_click(){
    u=location.href;
    t=document.title;
    d='param kumar';
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'t='+encodeURIComponent(t)+'&d'+encodeURIComponent(d),'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
 }
</script>
<body>
<div>
   <h2>Some content of my website pages..</h2>
</div>
<div id="fb">
   If a tag can have multiple values, just put multiple versions of the same tag on            your page. The first tag (from top to bottom) is given preference during conflicts.&nbsp;&nbsp;&nbsp;
   <a href="http://www.facebook.com/share.php?u=http://localhost/paramRND/FbShare.php" onclick="return fbs_click()" target="_blank"> Share on FB</a>
</div>
</body>
</html>

But when I click on the share on Fb button, after log in to Facebook it shows a blank page. Can any one help me out. thanks

  • 写回答

1条回答 默认 最新

  • dongrao9454 2014-01-02 08:53
    关注

    Your url //localhost/paramRND/FbShare.php it will not work for it.add url which is live.

    OR You can make your local machine accessible by using localtunnel . You'll need to (temporarily) change some URLs used in your app code / html so links point to the temporary domain, but at least facebook can reach your machine.

    评论

报告相同问题?

悬赏问题

  • ¥15 ogg dd trandata 报错
  • ¥15 高缺失率数据如何选择填充方式
  • ¥50 potsgresql15备份问题
  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错