Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 放置Facebook评论后重新定向到网页_Javascript_Facebook - Fatal编程技术网

Javascript 放置Facebook评论后重新定向到网页

Javascript 放置Facebook评论后重新定向到网页,javascript,facebook,Javascript,Facebook,我计划在网页上安装Facebook评论模块/插件,比如: 是否可以将用户重新定向到站点内的另一个登录页?假设我想在点击发表评论后将其发送至此处: Facebook API或其他脚本是否可以实现这一点?您可以订阅comment.create事件,当用户添加这样的评论时会触发该事件: 初始化 window.fbAsyninit=函数(){ FB.init({ appId:'感应应用程序id', 状态:true,//检查登录状态 cookie:true,//启用cookie以允许服务器访问会话

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

是否可以将用户重新定向到站点内的另一个登录页?假设我想在点击发表评论后将其发送至此处:


Facebook API或其他脚本是否可以实现这一点?

您可以订阅comment.create事件,当用户添加这样的评论时会触发该事件:

初始化


window.fbAsyninit=函数(){
FB.init({
appId:'感应应用程序id',
状态:true,//检查登录状态
cookie:true,//启用cookie以允许服务器访问会话
xfbml:true//解析xfbml
});
/*所有事件都已登记*/
FB.Event.subscribe('comment.create',函数(响应){
//重定向到http://www.example.com/landing-page/
window.location=”http://www.example.com/landing-page/";
});
};
(功能(){
var e=document.createElement('script');
e、 src=document.location.protocol+'//connect.facebook.net/fi_-fi/all.js';
e、 异步=真;
document.getElementById('fb-root').appendChild(e);
}());
在你的fb评论中,你必须像这样设置notify=“true”


<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:comments numposts="10" notify="true"></fb:comments>