Ajax twice + facbook login/logout
- by Devenv
Hi,
I have a very specific problem. The site I'm developing loads the FB connect button by ajax (it loads the box that includes FBC button).
And when user logs in it loads instead of it the box with FB logout link.
The problem is that FB requires to call FB.init() at the end of the body (when all the FB stuff is already on the page) and you can't do it twice as the second time is ignored.
So what happens is - I do FB.init() inside the login box and FBC button works perfectly, but the logout link doesn't as FB.init() doesn't work there.
The only solution I came up with is to place the login and logout buttons outside of ajax boxes and show them in the right places after ajax boxes are loaded. I'm pretty much sure this will work but I don't like the solution (which looks more like hack).