Click to See Complete Forum and Search --> : window.close for framset


ricks
02-13-2003, 09:21 AM
Is there a way to get window.close() to work on a frameset. For example I want to have a link in one of the frames of a frameset that will close the entire page.

TIA

Zach Elfers
02-13-2003, 09:23 AM
Try putting the window name, so window.windowName.close();

If that doesn't work, than this will. With the link that will close the window, instead of making it go to window.close(); make it go to a different page with the target as _top. On this new page put <body onload="self.close();"> and it should work.

gil davis
02-13-2003, 09:29 AM
From inside one of the pages contained in the frameset, use:

window.top.close();

BTW, if you did not open the window using JavaScript, you will get a prompt about attempting to close the window. There is nothing you can do about it. It's a security thing.

ricks
02-13-2003, 11:34 AM
Originally posted by gil davis
From inside one of the pages contained in the frameset, use:

window.top.close();

BTW, if you did not open the window using JavaScript, you will get a prompt about attempting to close the window. There is nothing you can do about it. It's a security thing.


This was exactly what I was looking for. Thanks!