0
window.fbAsyncInit = function(){
FB.Event.subscribe('comment.create', function(response){
$.ajax({
type: "POST", // form method
url: "/pages/includes/add_fb_comments.php",// destination
data: "url=" + encodeURIComponent(response.href) + "&id=<?=$id?>&action=add",
cache: false,
success: function(){
alert('Success' + encodeURIComponent(response.href) + response.commentID);
}
});
});
};
하지만, 그러나 내가 다음, 아무것도 화재를 추가 할 때마다, 아약스는 발생하지 않으며 내가 '같은 window.fbAsyncInit = function(){
내 모두를 시도했습니다
FB.Event.subscribe('comment.remove', function(response){
$.ajax({
type: "POST", // form method
url: "/pages/includes/add_fb_comments.php",// destination
data: "commentID=" + response.commentID + "&action=remove",
cache: false,
success: function(){
alert('removed comment: ' response.commentID);
}
});
});
때문에 더 성공 메시지하지 않습니다 ve는 분리되어 시도했다 window.fbAsyncInit = function(){
나는 완전한 별도의 시도를했다 심지어 <script></script>
그러나 그들은 단지 발사하지 않는다.
이 문제는 알려진 문제입니까? 나는 그들이 항상 함께 존재한다고 확신 할 수 없다.
어떤 아이디어라도?
이 내가 노력하고있어 전체 실제 코드 :
<div class="fb-comments" data-href="<? echo curPageURL(); ?>" data-num-posts="4" data-width="578" mobile="false"></div>
<script>
window.fbAsyncInit = function(){
FB.Event.subscribe('comment.create', function(response){
$.ajax({
type: "POST", // form method
url: "/pages/includes/add_fb_comments.php",// destination
data: "url=" + encodeURIComponent(response.href) + "&id=<?=$id?>&action=add",
cache: false,
success: function(){
alert('Success' + encodeURIComponent(response.href) + response.commentID);
}
});
});
};
window.fbAsyncInit = function(){
FB.Event.subscribe('comment.remove', function(response){
$.ajax({
type: "POST", // form method
url: "/pages/includes/add_fb_comments.php",// destination
data: "commentID=" + response.commentID + "&action=remove",
cache: false,
success: function(){
alert('removed comment: ' response.commentID);
}
});
});
};
</script>