View Full Version : avoid open same window twice

06-04-2006, 07:41 PM
I have a link on a page which opens up a new page, however, every time it is clicked, a new page is opened. 10clicks=10new windows of same page

is there a way that i can check whether this page is already opened in new window, if yes, just bring this window up, if no, open it?

Bill Posters
06-04-2006, 08:09 PM
Use a single, custom target name instead of _blank.

basic e.g.

<a href="link1.html" target="mynewwindow">link1</a>
<a href="link2.html" target="mynewwindow">link 2</a>

- or -

Use a single, custom target name in all your popup scripts

basic e.g.

function mypopup() {
var newWin = window.open(url,'mynewwindow');

<a href="link1.html" onclick="mypopup(this.href); return false;">link1</a>
<a href="link2.html" onclick="mypopup(this.href); return false;">link 2</a>

06-05-2006, 05:44 AM
thx Bill, problem solved :)