How to close parent window in Firefox and Chrome
.. and possible also in Opera, Safari etc.
The problem:
1: parent.window.close();
that working well in IE8 but not working in Firefox and Chrome. Some state that for security reasons.
Solution (lol):
1: top.window.close();
A little more details:
I have a page that opens popup using showModalDialog(….) function.
Inside popup i have a frameset(old project) with two frames. One of them have button which onclick="parent.window.close()" not working in FF but onclick="top.window.close()" successfully closes popup.
If You american citizen do something with SOPA because it can be "ZHOPA".
Good Luck!
Filed under: html • javascript
Like this post? Subscribe to my RSS feed and get loads more!

Leave a Reply