posted 21 years ago
Well,
if you opened window using
window.open("http://www.yahoo.com", "WndName")
then to close it, you need to todo:
window.open("", "WndName").close();
the side effect is: if you did not open window before, it will be opened and close.
There is also a funny behavior on IE5+, that you could use:
Properties added/change on window.location remains during window lifetime.
So, if when you open window, you do:
window.location.myWnd = window.open("http://www.yahoo.com", "WndName");
than to close it:
if(window.location.myWnd && !window.location.myWnd.closed){
window.location.myWnd.close();
window.location.myWnd = null;
}