Facebook订阅回电

时间:2012-01-31 01:56:37

标签: ajax facebook call back subscribe

Facebook订阅没有回电话。回调如何成功?

<script> window.fbAsyncInit = function() { 
 FB.init({status: true, cookie: true, xfbml: true});  var user= "<?
 echo $data->id;?>"; 
 document.getElementById("Hint").style.display='block'; 
 FB.Event.subscribe('edge.create', function(response) {
     $.ajax({
         type: "POST",
         url: "fbareceive.php",
         data: "data="+response + "---" + user,        
         cache: false
     });
 (function() {  var e = document.createElement('script');  e.type =
 'text/javascript';  e.src = document.location.protocol +
 '//connect.facebook.net/en_US/all.js';  e.async = true; 
 document.getElementById('fb-root').appendChild(e);  }());

 </script>

1 个答案:

答案 0 :(得分:0)

$ .ajax()是一个jQuery函数。请阅读相关文档:http://api.jquery.com/jQuery.ajax/

简言之:

$.ajax({
         type: "POST",
         url: "fbareceive.php",
         data: "data="+response + "---" + user,        
         cache: false,
         success: function(){
                alert('Success');
            }
        });