Reputation: 271644
<fb:login-button onlogin="window.location = '/custompage.html';">Connect</fb:login-button>
That's currently my code for users to log in to my site. It's in FBML.
It will pop up a box, the user then logs in. And then, it closes the new window, followed by a redirect to "custompage.html".
Now, I would like to manually render my button instead of using FBML, because it's too slow on mobile" http://wiki.developers.facebook.com/index.php/Facebook_Connect_Login_Buttons#Facebook_Connect_for_iPhone_Buttons
How do I close the popup window and redirect, using this code as explained in the doc?:
<a href="" onclick="FB.Connect.requireSession();return false;"><img src="http://wiki.developers.facebook.com/images/6/6f/Connect_iphone.png"></a>
Upvotes: 1
Views: 840
Reputation: 12376
The code you want run on successful login should be passed as an argument to requireSession()
. In your case, I believe you want
<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>
Upvotes: 1
Reputation: 271644
Fixed. put this inside the requireSession:
function() { window.location='/'; }
Upvotes: 0