问题描述:

Following code checks if user is logged in using facebook connect if not when user clicks on check box the code opens facebook to input username and password to connect with facebook. The problem i am having is if user clicks on checkbox and gives acces to facebook connect the code does not update under i refresh the page. Is there a way to update this code if user login on facebook without refreshing page?

<?

if($user['oauth'] != "facebook")

{

?>

<input type="checkbox" name="fb_post_1" id=\"fb_post_1" value="1" onclick = "facebookPermissionsGrant(); return false;" >

<?

}

?>

网友答案:

If you're using the Javascript API then you simply provide a callback to the FB.login function, and add code to do whatever you need there.

See https://developers.facebook.com/docs/reference/javascript/FB.login/

相关阅读:
Top