我需要一些关于如何使用您的Google+帐户登录的网站创建退出功能的帮助.
文档说明您应该使用gapi.auth.signOut函数
https://developers.google.com/+/web/signin/sign-out
但作为javascript的新手我似乎没有任何运气.
这是我的代码 - 注销功能是底部的部分.我究竟做错了什么?
<script>
function signinCallback(authResult) {
if (authResult['status']['signed_in']) {
// Update the app to reflect a signed in user
// Hide the sign-in button now that the user is authorized, for example:
document.getElementById('signinButton').setAttribute('style','display: none ');
document.getElementById('callback').setAttribute('style','height: 100px;background-color: red ');
var mydiv = document.getElementById("callback");
var aTag = document.createElement('a');
aTag.innerHTML = "Sign out";
aTag.id= "signout";
mydiv.appendChild(aTag);
/*function checkid(){
document.getElementById('signout')
}*/
} else {
// Update the app to reflect a signed out user
// Possible error values: …Run Code Online (Sandbox Code Playgroud)