no refresh

Imagine this code:
<a href=‘#’ onClick=“‘url’,‘window name’,‘width=250,height=600,screenX=25,screenY=25,resizable=yes,scrollbars=yes’)”>
link name</a>

It does open a new window as i want it. The only thing that annoys me is that everytime i click in that link the parent window refreshes. How do i prevent that from happening?

Check if the window exists already and return false if it does.

Please explain more what you mean. I forgot to mention that im a total newbie in javascript.

Just to be perfectly clear on what my problem is:
I have a link on my index page. When someone clicks on that link it opens a new window with some text in it. The problem is whenever someone clicks on that link and the new window opens it automaticly refreshes the page where the link is (index page).

Thx for any help

<a href='#' onClick="[color=red]return ![/color]'url','window name','width=250,height=600,screenX=25,screenY=25,resizable=yes,scrollbars=yes ')">
link name</a>

If you don’t return false, the browser follows the link.

A more common approach is to return false at the end.

<a href='#' onclick="'url','window name','width=250,height=600,screenX=25,screenY=25,resizable=yes,scrollbars=yes '); return false">
link name</a>

The method I suggested has two advantages:

[list=1][]It will make the link work as a regular link if the window cannot be opened, e.g., if JavaScript is disabled. (Not that it would do much good in this case, where the URL is ‘#’, but in a more user-friendly page it would.)
]It’s a few characters shorter. :)[/list]

The fourth parameter of (which hardly anyone uses) controls whether an already open window should be overwritten or not.

Thx guys! Works like a charm. I used AutisticCuckoo advice. That was certanly an very easy solution. Strange that this solution already wasnt on this forum. Anyways, thank you very much. :smiley: