2012-10-09 24 views

回答

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評論您必須設置通知=「真」之類所以

<fb:comments numposts="10" notify="true"></fb:comments> 
相關問題