In Javascript you can close any window provided:
- The window was opened by Javascript in the first place
- The document you're trying to close the window from is in the same security domain as the on you're running the script from (usually this means that they're from the same server)
- You have a reference to the window you want to close.
Passing references to window objects between windows is possible. When you open a window (using window.open method in JS), a reference to the newly opened window is returned. Also, a window opened in this manner will have its "opener" property set to a reference to the window which opened it.
Mark