antony061897
asked on
False HREFS ?
Can someone please give me the correct syntax for false HREFS?
I current use <A HREF="#" ....>
This creates 'bad' navigation history, so I rather not use this method.
Cheers
Antony
I current use <A HREF="#" ....>
This creates 'bad' navigation history, so I rather not use this method.
Cheers
Antony
hmm...i always use <A HREF="#bogus" ...> which never gave me problems...
I have also seen:
<a href="javascript:void()"> (and some variations)
and
<a href="">
Don't know how they affect the History, though.
Tom
<a href="javascript:void()"> (and some variations)
and
<a href="">
Don't know how they affect the History, though.
Tom
A variation of Tom's suggestion:
<a href="javascript:;" onClick='location="myurl.h tm";return (true);'>
<a href="javascript:;" onClick='location="myurl.h
ASKER
TTom,
Your suggestion worked great.
I didn't use KnightEknight's as I already use the OnClick to call other scripts.
Cheers, submit as answer so I can rate it.
Antony
Your suggestion worked great.
I didn't use KnightEknight's as I already use the OnClick to call other scripts.
Cheers, submit as answer so I can rate it.
Antony
if you're using the onclick-event to fire a script maybe you'd like to either use an empty function in the HREF, or link the HREF to a script letting those without JavaScript know what's going on?
<a href="javascript:myVoid()" onclick=" ... "> with
function myVoid() { ; }
is the void-approach (often seen used by our local JavaScript guru Michel Plungjan). he creates his own void()-function because some browsers (maybe the older ones) haven't got void().
<a href="otherpage.html" onclick="event();return false;">
is the other approach. the 'return false' makes sure the link isn't followed for those with JavaScript enabled.
<a href="javascript:myVoid()"
function myVoid() { ; }
is the void-approach (often seen used by our local JavaScript guru Michel Plungjan). he creates his own void()-function because some browsers (maybe the older ones) haven't got void().
<a href="otherpage.html" onclick="event();return false;">
is the other approach. the 'return false' makes sure the link isn't followed for those with JavaScript enabled.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.