I'm running a facebook Connect site where I use Connect for authentication. I check if the user is connected through facebook on every page so that I can quickly authenticate them if they are registered.
I think that my current way of doing this may be bad, because the page "hiccups" whenever it loads in users from facebook connect. That is to say, page elements are visibly re-rendered, and the user's facebook profile pic flashes a bit before loading in. I'm pretty sure there's a better way because I've seen Facebook Connect Authentication without these "hiccups". Here's my working and very basic code:
<body onload="fbConnect();">
<!-- page contents -->
<script type="text/javascript">
function fbConnect()
{
FB.init([MYAPPKEY], "xd_receiver.htm",{"reloadIfSessionStateChanged":true});
}
</script>
</body>
</html>
I take advantage of that reload to authenticate the user on the site if they're Facebook Connected. So is there a way to improve my method and eliminate the hiccups?