1

我计划在网页上安装 Facebook 评论模块/插件,假设:

http://www.example.com/

是否可以将用户重定向到网站内的另一个登录页面?假设我想在点击发表评论后将它们发送到这里:

http://www.example.com/landing-page/

这可以通过 Facebook API 或其他脚本实现吗?

4

1 回答 1

0

您可以订阅 comment.create 事件,该事件在用户添加如下评论时触发:

在里面

<div id="fb-root"></div>
<script>
    window.fbAsyncInit = function() {
FB.init({
    appId  : 'sensored-app-id',
    status : true, // check login status
    cookie : true, // enable cookies to allow the server to access the session
    xfbml  : true  // parse XFBML
});

/* All the events registered */
FB.Event.subscribe('comment.create', function (response) {
    // Redirect to http://www.example.com/landing-page/
    window.location = "http://www.example.com/landing-page/";
});



};

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

在您的 fb 评论中,您必须像这样设置 notify="true"

<fb:comments numposts="10" notify="true"></fb:comments>
于 2012-10-09T20:00:50.227 回答