Href - Please do not reload with target specified

M

Mel

I have a navigation page, very long list of urls and when you click a
link it is opened in a new window.

THE PROBLEM:

When i scrolldown the navaigator and click on a link, it refreshes
itself, even when i have target specified.

How can i avoid this

thanks in advance
 
N

nice.guy.nige

While the city slept, Mel ([email protected]) feverishly typed...
I have a navigation page, very long list of urls and when you click a
link it is opened in a new window.

THE PROBLEM:

When i scrolldown the navaigator and click on a link, it refreshes
itself, even when i have target specified.

How can i avoid this

It sounds like you are using javascript in the onclick handler to open a
window, and using href="#". This is A Bad Idea. Try using something like;

<a href="myfile.html" onclick="myOpenWinFunc(this.href); return false;">My
File</a>

instead... Obviously replace the myOpenWinFunc() part with whatever you use
to open the window... This would call a function called myOpenWinFunc() with
the value of href (the uri of the file you want to open). The return false
part stops the file in href from being opened. If javascript is not
available - or not enabled - then the file specified in the href will open
normally, so it will work even if javascript is not available to - or not
desired by - the end-user.

Of course, I could have got the wrong end of the stick, in which case I am
sorry... my crystal ball is at the cleaners today ;-)
thanks in advance

You're welcome. Hope it helps.

Cheers,
Nige
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top