I'm doing a Facebook Connect integration for a site and when the user logs in, I need to ask for some permissions so I use FB.Connect.showPermissionDialog. I use its callback to see if permissions were granted. If they are granted, I want to submit the form. Here's what my code looks like:
$("#form3").live("submit", function() {
FB.Connect.showPermissionDialog('email, offline_access', function(perms) {
if (!perms) {
location.href="http://www.mysite.com/logout/";
return false;
} else {
save_session();
}
});
});
The problem is that the form submits before the user can even see the permission dialog. Has anyone seen this before?