Hello all,
I am trying to close a window when I press a link using javascript.
The code is simple...
Code:
<a href="" onclick="window.close()">Close this window</a>
This works as well, and I know that it will work only on windows opened by javascript. That's ok as well.
My question is that in Firefox, I can open a link a new tab. So I open a new tab by clicking on a link like this...
Code:
<a href="somepage.html" target="_blank">OPEN</a>
Now when I try to close this tab using javascript, after closing it refreshes the page. This I know is happening because, I did href="".
What's the workaround for this problem....