How does one close a window in javascript if all you know is the name of the window?
kansel
12-07-2004, 09:00 PM
If you know the name of the window (as set in a window.open() command or with window.name='something'), but do not have a pointer to the window itself, you can recreate the pointer by re-opening the window, then close it with the new pointer. The downside to this approach is that if the window is not open in the first place, a new window will be opened and immediately closed.
var w = window.open('',windowName);
w.close();
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.