在墙上发布消息时出错

时间:2012-04-03 05:36:16

标签: facebook facebook-graph-api

我想在用户的墙上发布示例消息。但是FB.ui方法没有执行,我收到一条消息“发生错误。请稍后再试”。这是正文中的代码:

<div id="fb-root"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"
    type="text/javascript"></script>
<script>
 window.fbAsyncInit = function() {
alert('hiee');   

 FB.init({appId: '259494234140448', status: true, cookie: true,
 xfbml: true});

 };
 (function() {

 var e = document.createElement('script'); 
 e.async = true;
 e.src = document.location.protocol +
 '//connect.facebook.net/en_US/all.js';
 document.getElementById('fb-root').appendChild(e);

 }());
 </script>
<script type="text/javascript">
function publish_to_wall(){  

    FB.ui({ method: 'stream.publish',    
        message: 'This is a simple post to appshack.tv'   });
    }
        </script>
}
<a href="javascript:publish_to_wall()">Publish to your wall</a>

1 个答案:

答案 0 :(得分:0)

在该用户对您的应用进行身份验证之前,您无法发布到用户的墙上。