Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- PHPWind-- A PHP forum script applcaition in China
- Using Cron Job to process PHP scripts
- Install PHPMailer 5.2.4 and use smtp gmail
- Set up a child account and set screen time limit in Windows 8
- PHP connect IBM db2 database in XAMPP
- job interview questions (1)
- PHP - Export Content to MS Word document
- Datatable export excel wraptext and newline
- Powerful js library datable to export table in pdf, excel, sorting, freezing column and table header fixed (sticky)
- Ajax autosave selection without submit button
Wednesday, October 31, 2012
Google account logout script in Google application
Gmail logout link:
https://www.google.com/accounts/Logout
or
https://mail.google.com/mail/u/0/?logout&hl=en
Google account logout link:
https://mail.google.com/mail/?logout&hl=en
JS script:
<script type="text/javascript">
popup1=window.open("https://mail.google.com/mail/?logout&hl=en",'','width=600,height=400');
</script>
can be used to logout Gmail account.
But I do not like the popup window. I used Google oauth 2.0 to login my Google calendar application. When users login the Google account in popup window, they may think they login in oauth 2.0 in my Google calendar application.
So I need to hide the logout popup window. If users need to login, they should go to my login button using oauth 2.0.
After I added popup1.close(); the popup window is closed, but users are not logged out.
<script type="text/javascript">
popup1=window.open("https://mail.google.com/mail/?logout&hl=en",'','width=600,height=400');
popup1.close();
</script>
Using Iframe, finally the following script logged out the Google account without popup new window.
<script type="text/javascript">
document.getElementById('myIFrame').src='https://www.google.com/accounts/Logout';
timeOut();
</script>
<iframe id="myIFrame" src="" style='display:none;' >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment