I have Logout Button in my web application & need to close the tab as soon as i click on logout button which is not happening at the moment in firefox rest other browser are working fine with the below solution.
Works fine in all browser except Firefox.
onclick="javascript:window.close();opener.window.focus();">
Scripts may not close windows that were not opened by script
-
- Posts: 1
- Joined: April 19th, 2017, 11:43 pm
- DanRaisch
- Moderator
- Posts: 127231
- Joined: September 23rd, 2004, 8:57 pm
- Location: Somewhere on the right coast
Re: Scripts may not close windows that were not opened by sc
Moving to Web Development.
- Frenzie
- Posts: 2135
- Joined: May 5th, 2004, 10:40 am
- Location: Belgium
- Contact:
Re: Scripts may not close windows that were not opened by sc
Other browsers are obviously broken. Users should be in control of their browser windows.
Why not simply redirect back to the login screen or to a news page or some such?
Why not simply redirect back to the login screen or to a news page or some such?
Intelligent alien life does exist, otherwise they would have contacted us.
-
- Posts: 270
- Joined: January 20th, 2015, 12:29 pm
Re: Scripts may not close windows that were not opened by sc
Maybe add a redirect after you run window.close(), that goes to a page saying "you can now close this window" or something similar.