成功登录后删除Facebook登录按钮

时间:2015-07-10 20:19:40

标签: javascript facebook

我试图使用Facebook创建登录/注销机制。到目前为止,我已经设法编辑默认的Javascript SDK(具有基本的JS知识),只在用户登录时才显示注销链接。但是无论用户是否登录,登录按钮都会持续存在。这是代码:

echo Please, enter file location as a sub-directory
read LOCATION
cd $LOCATION
find . "(" -name "*.py" ")" -print0 | xargs -0 wc -l

2 个答案:

答案 0 :(得分:1)

I found another solution. Removing the logout div altogether I added the autologoutlink="true" to the login button (removing the div from login also):

<fb:login-button autologoutlink="true" scope="public_profile,email" onlogin="checkLoginState();">
</fb:login-button>

答案 1 :(得分:0)

好的家伙使用上面的答案我创建了一个解决方案:

我在testAPI()函数中添加了以下行:

document.getElementById('login-button').style.display = 'none';

我还将登录按钮嵌入到div中:

<div id="login-button">
    <fb:login-button scope="public_profile,email" onlogin="checkLoginState();">
    </fb:login-button>
</div>