| Author |
parent.window.close() is working only for IE
|
Shashi Kala
Ranch Hand
Joined: Jan 27, 2008
Posts: 46
|
|
Hi all, I have a hyper link i.e. 'logout'. When I click on it. the window should gets closed. To do so I wrote a javascript method as shown below. function closing() { parent.window.close(); } But this is working for only Internet Explorer..I have tried in Opera, Fire Fox, Netscape but in these browsers it is not working..I tried parent.parent.window.close() & top.window.close() functions too. But failed. Can anybody guess the problem here ?? With Regards, Shashi Kala
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
It is browser security. If you did not create the window with window.open, you can not close it. Eric
|
 |
Shashi Kala
Ranch Hand
Joined: Jan 27, 2008
Posts: 46
|
|
|
Then, there is no other solution for this..
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56162
|
|
|
Correct.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Shashi Kala
Ranch Hand
Joined: Jan 27, 2008
Posts: 46
|
|
|
Disappointed!! Thank you all.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56162
|
|
Originally posted by Shashi Kala: Disappointed!
Don't be. Just be glad that any old web site can't close your browser!
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
As Bear stated, I am glad that I do not go to some site and my browser just goes away. I would be a little ticked if that would happen. Eric
|
 |
Shashi Kala
Ranch Hand
Joined: Jan 27, 2008
Posts: 46
|
|
Yah!! I can be glad
|
 |
 |
|
|
subject: parent.window.close() is working only for IE
|
|
|