Tôi đang cố gắng nắm bắt sự kiện khi nhận xét được gửi. Tôi đang làm gì sai? Tôi chỉ muốn cập nhật mọi nhận xét của người dùng cũng vào tường nhóm facebook và đó là lý do tại sao tôi cần phải nắm bắt sự kiện.FB.Event.subscribe + comments.add không hoạt động?
<fb:comments numposts="10" ></fb:comments>
FB.init và sự kiện catcher:
<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('comments.add', function (response) {
// do something with response
alert("comment added");
});
};
(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>
tôi sẽ đặt mã này ở đâu nếu tôi có trang web drupal? – LTech