WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Is javascript a big issue?

for

From: Jukka K. Korpela
Date: Mar 15, 2004 3:00AM


On Mon, 15 Mar 2004, Chris Price wrote:

> I was thinking of where a link is coded <a
> href="javascript:clickLink('whatever')"> and no allowance is made for
> javascript not running so the link looks OK but when you click, nothing
> happens.

Such constructs have the extra problem that they comply with _no_
specification, since javascript: is not a publicly defined and registered
URI (URL) scheme. Even some JavaScript-enabled browsers refuse to
recognize such constructs. (This might be a weak argument, since this
probably applies to a few past versions of Opera only. But you need not
tell everything. :-))

> My reason for asking this is not 'how lazy can I be' but what incentive am I
> going to give someone to be more thoughtful in their coding. Its not about
> going that extra mile, a couple of inches would help.

A fairly strong practical argument is that such "links" are not recognized
as links by indexing robots. And especially Google uses links (real links,
that is) as very important indicators of page popularity.

And doing things right is easy, as soon as you learn the habits. Using
<a href="..." onclick="..."> with suitable arguments is smooth sailing.
For details see
http://www.cs.tut.fi/~jkorpela/forms/javascript.html#window

--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/


----
To subscribe, unsubscribe, suspend, or view list archives,
visit http://www.webaim.org/discussion/