6 replies [Last post]
niclipse
niclipse's picture
Offline
Enthusiast
Last seen: 14 years 11 weeks ago
Joined: 2006-02-08
Posts: 54
Points: 0

How do we get around this:

a href="javascript:" /A

use on click?

Tags:
niclipse
niclipse's picture
Offline
Enthusiast
Last seen: 14 years 11 weeks ago
Joined: 2006-02-08
Posts: 54
Points: 0

onmousedown?

onmousedown?

SuperRoach
SuperRoach's picture
Offline
Enthusiast
Ballarat
Last seen: 10 years 43 weeks ago
Ballarat
Timezone: GMT+10
Joined: 2007-02-26
Posts: 291
Points: 6

So to clarify, you want to

So to clarify, you want to have a javascript onclick or something on a tag, to replace the a href.

why not have a null function like:
javascript:void(0);

?

niclipse
niclipse's picture
Offline
Enthusiast
Last seen: 14 years 11 weeks ago
Joined: 2006-02-08
Posts: 54
Points: 0

having "javascript:" in a

having "javascript:" in a href is deprecated. I was wondering what the official fix is. I am using a href=# onmousedown

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 25 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Moving to 'Off Topic' this

Moving to 'Off Topic' this isn't a CSS question, please choose appropriate sub forums for posts.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Chris..S
Chris..S's picture
Offline
Moderator
Last seen: 9 years 41 weeks ago
Timezone: GMT+1
Joined: 2005-02-22
Posts: 6078
Points: 173

Is it deprecated? Even if

Is it deprecated?

Even if not, its not very good practice to use it. It makes the page unusable by anyone without javascript or without javascript turned on. It is better to ensure there is initially a working link that will show content in a similar way to the results of the javascript.

Triumph (not verified)
Anonymous's picture
Guru

niclipse wrote:having

niclipse wrote:
having "javascript:" in a href is deprecated.

Can you link me to more information on this. It is news to me.