Facebook Connect:登录后重新加载网页

时间:2011-10-27 02:06:07

标签: javascript facebook

http://www.stubwire.com/account/login.php我正在尝试添加Facebook Connect,一旦登录,就会重新加载页面。我试过搜索,我看到其他帖子,但无法弄清楚为什么我的页面无效。有人可以帮我弄清楚为什么这不起作用吗?

<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '139440482805508',
      status     : true, 
      cookie     : true,
      xfbml      : true
    });
    FB.Event.subscribe('auth.login', function(response) {
      window.location.reload();
    });
    FB.Event.subscribe('auth.statusChange', function(response) {
      window.location.reload();
    });
    FB.Event.subscribe('auth.authResponseChange', function(response) {
      window.location.reload();
    });
  };
  (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
</script>

0 个答案:

没有答案