2011-08-24 169 views
1

我正在顯示Facebook註冊iframe厚框(iframe裏面的iframe)。Facebook註冊問題

(如果用戶沒有登錄,按鈕將顯示給登錄或其他登記表將直接示出。)

克羅姆是緩存的數據。因爲這樣登錄到Facebook後,它顯示錯誤,如「無效的client_id」(它不顯示我的註冊表格)。如果我重新加載父iframe即。 thickbox窗口註冊表顯示正常。

我想在登錄Facebook後重新加載thickbox iframe。我可以如何獲得這個控制?有沒有任何JS代碼可用於此?

這裏是我的代碼

<div id="content"> 
    <div class="reg-cont"> 
     <div id="fb-root"></div> 
     <script type="text/javascript"> 
      window.fbAsyncInit = function() { 
       FB.init({ 
        appId : '<?php echo $this->facebookAppId; ?>', 
        status : true, 
        cookie : true, 
        xfbml : true 
       }); 
       FB.getLoginStatus(function(response) { 
        if (response.status == "connected") { 
         window.location = "/facebook-login?facebook_uid=" + response.session.uid; 
        } 
       }); 
      }; 
     </script> 
     <fb:registration 
      fields="[ 
          {'name':'name'}, 
          {'name':'email'}, 
          {'name':'church', 'description':'Home Church', 'type':'select', 'options':<?php echo str_replace('"', "'", $this->church); ?>, 'default':'none'}, 
          {'name':'host', 'description':'Check this box if you are hosting your small group', 'type':'checkbox'} 
        ]" 
      redirect-uri="http://<?php echo $_SERVER['SERVER_NAME']; ?>/User/index/create-facebook-account" 
      fb_only="true" 
      width="530"> 
     </fb:registration> 
    </div> 
</div> 

回答

0

刷新上登錄有針對性的iframe中。您將需要設置下面

FB.Event.subscribe('auth.login', function(response) { 
     top.frames['YourFrameName'].location.href = 'http://example.com/'; 
    }); 

<script type="text/javascript"> 
     window.fbAsyncInit = function() { 
      FB.init({ 
       appId : '<?php echo $this->facebookAppId; ?>', 
       status : true, 
       cookie : true, 
       xfbml : true 
      }); 
      FB.getLoginStatus(function(response) { 
       if (response.status == "connected") { 
        window.location = "/facebook-login?facebook_uid=" + response.session.uid; 
       } 
      }); 
    FB.Event.subscribe('auth.login', function(response) { 
    top.frames['YourFrameName'].location.href = 'http://example.com/'; 
    }); 
     }; 
    </script> 
+0

此鏈接,和幀名稱,如果用戶登錄Facebook將重定向頁面。我需要在用戶登錄後顯示註冊塊。 – Sahal