Imagine this code:
<a href=‘#’ onClick=“window.open(‘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?
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).
[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]
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.