当前位置: 动力学知识库 > 问答 > 编程问答 >

php - getting facebook permission returned without refreshing page

问题描述:

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/

分享给朋友:
您可能感兴趣的文章:
随机阅读: