2010-02-23 43 views
1
<fb:login-button onlogin="window.location = '/custompage.html';">Connect</fb:login-button> 

這是目前我的用戶登錄到我的網站的代碼。它在FBML中。Facebook的連接按鈕的問題 - 請幫助

它會彈出一個框,然後用戶登錄。然後關閉新窗口,然後重定向到「custompage.html」。

現在,我想手動使我的按鈕,而不是使用FBML的,因爲它的移動速度太慢」 http://wiki.developers.facebook.com/index.php/Facebook_Connect_Login_Buttons#Facebook_Connect_for_iPhone_Buttons

如何關閉彈出窗口和重定向,使用此代碼作爲解釋。DOC?:

<a href="" onclick="FB.Connect.requireSession();return false;"><img src="http://wiki.developers.facebook.com/images/6/6f/Connect_iphone.png"></a> 

回答

1

您希望在成功登錄時運行的代碼應作爲參數傳遞給requireSession()。在你的情況下,我相信你想要

<a href="" onclick="FB.Connect.requireSession(function() { 
    window.location = '/custompage.html' 
    });return false;"> 
    <img src="http://wiki.developers.facebook.com/images/6/6f/Connect_iphone.png"> 
</a> 
0

固定 把這個requireSession內:

function() { window.location='/'; }