views:

27

answers:

1

I have an application window that displays a button. On button click, a new tab is opened with window.open javascript function and later I would like to be able to detect if that link is opened or not and if it is, I need to close that window. Can this be done in Firefox ?

Thanks.

+1  A: 

The window.open() function returns a Window object. Just call close() on it:

var childWindow = window.open(....);

...

childWindow.close();
Aaron Digulla
But check it first: if (childWindow
mplungjan