不使用简单的送纸方法在朋友的墙上张贴

时间:2013-05-22 06:24:42

标签: javascript html facebook-javascript-sdk

我几乎浪费了一整天的时间来寻找为什么不在朋友的墙上张贴

请帮助

我没有收到任何错误,但邮件似乎没有出现在朋友的墙上。

我得到一个对话框,说要在朋友的墙上张贴..当我通过点击分享确认它关闭但朋友墙上没有变化

我尝试了许多不同的朋友墙检查任何隐私政策,但我不认为这是关注的问题。

如果我没有指定“to”参数,它会在我的个人资料中发布,但只有问题在于朋友墙

代码如下

<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.js">    
</script>

<script src="http://connect.facebook.net/en US/all.js">
</script>

<script type="text/javascript">

window.fbAsyncInit = function() 
{
    FB.init
    (
        {
            appId  : 'appid',
            status : true, // check login status
            cookie : true, // enable cookies to allow the server to access the session
            xfbml  : true , // parse XFBML
            oauth : true // Enable oauth authentication
        }
    );
};

   $(document).ready(function () 
   {
        $('#shareonfacebook').click(function (e) 
        {
            e.preventDefault();
            var obj=
            {
                    method: 'feed',
                    name: 'DvimayPostPhoto',
                    link: 'http://localhost/FaceBook/index.html',
                    picture: 'http://www.fbrell.com/public/f8.jpg',
                    caption: 'hey how is my Application ? tell me dude',
                    description: 'hey how is my Application ?',
                    to: 'frnd id',
                    message: ''
            };
            function callback(response)
            {
                document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
            }

            FB.ui(obj, callback);

        });
    }
    );
</script>
<script>
FB.init({appId : 'app id'});
</script>

</head>
<body>
 <div id="fb-root"></div>
 <script>
(function() 
{
     var e = document.createElement('script'); 
     e.src = document.location.protocol +'//connect.facebook.net/en_US/all.js';
     e.sync= true;
     document.getElementById('fb-root').appendChild(e);
}
);
 </script>

<script src="C:/Users/Dvimay/Desktop/HIGHCHARTS/js/highcharts.js"></script>
<script src="C:/Users/Dvimay/Desktop/HIGHCHARTS/js/modules/exporting.js"></script>
<div id="container" style="height: 400px;width:500px;"></div>

<input type="button" id="shareonfacebook" value="Share This Link on Facebook"></input>

</html>

1 个答案:

答案 0 :(得分:0)

你从FB.ui()得到了什么回应?看代码,似乎没问题。我能想象的唯一可能的情况是,你的朋友已经禁止在他/她的墙上张贴的许可。你尝试过任何其他朋友的身份吗?