WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: using script emulated links; preferable or not- wcag2

for

Number of posts in this thread: 3 (In chronological order)

From: Shrirang Sahasrabudhe
Date: Sun, Jan 20 2008 10:30PM
Subject: using script emulated links; preferable or not- wcag2
No previous message | Next message →

Hi,
If i understand it correctly,
wcag2 prohibits using scripting to emulate links (correct me if wrong)
<Failures for SC 2.1.1>
the document lists following test procedure to check the compliance
F42: Failure of Success Criterion 1.3.1 and 2.1.1 due to using scripting events to emulate links | Techniques for WCAG 2.0
Test Procedure
list of 2 items
1. Check whether there are JavaScript event handlers on an element that emulates a link.
2. Check whether the programmatically determined role of the element is link.
list end

Expected Results
list of 1 items
If check #1 is true and check #2 is false, then this failure condition applies and content fails the Success Criterion.
list end
i think i can do 2 things here to achieve wcag2 compliance
1. use script emulated links and set the role to "link"
2. for every emulated link provide an alternative html link

which one is the better alternative not just from compliance but from usability perspective as well?
thanks
Shri


***********************************************************
If you try, you risk failure. If you don't, you ensure it....I try.
Shrirang Sahasrabudhe,
Pune, India.
Phone: 0091-020-4227558.

---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.

From: Patrick H. Lauke
Date: Mon, Jan 21 2008 1:20AM
Subject: Re: using script emulated links; preferable or not- wcag2
← Previous message | Next message →

Shrirang Sahasrabudhe wrote:

> If i understand it correctly,
> wcag2 prohibits using scripting to emulate links (correct me if wrong)
> <Failures for SC 2.1.1>
> the document lists following test procedure to check the compliance
> F42: Failure of Success Criterion 1.3.1 and 2.1.1 due to using scripting events to emulate links | Techniques for WCAG 2.0
> Test Procedure
> list of 2 items
> 1. Check whether there are JavaScript event handlers on an element that emulates a link.
> 2. Check whether the programmatically determined role of the element is link.

> which one is the better alternative not just from compliance but from usability perspective as well?

The main problem this SC addresses (from my understanding) is things
like attaching an onclick handler on, say, a DIV or a SPAN or something,
as that may work for mouse users, but not keyboard users (as the element
is not in the normal tab cycle, so can't be focussed and activated
normally, and AT doesn't understand that the element acts as a link).
Your better alternative is to actually use an A element (or even better,
if it relies on scripting entirely, *generate* an A element or use Hijax
techniques http://www.google.co.uk/search?q=hijax )

P
--
Patrick H. Lauke
______________________________________________________________
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
______________________________________________________________
Co-lead, Web Standards Project (WaSP) Accessibility Task Force
http://webstandards.org/
______________________________________________________________
_______________________________________________
To manage your subscription, visit http://list.webaim.org/
Address list messages to = EMAIL ADDRESS REMOVED =

From: Christian Heilmann
Date: Mon, Jan 21 2008 1:30AM
Subject: Re: using script emulated links; preferable or not- wcag2
← Previous message | No next message

> which one is the better alternative not just from compliance but from usability perspective as well?

That is the alternative. Compliance without being usable is not making
any sense for the end users or the success of the product. Adding HTML
that only works with JavaScript adds extra weight that is not needed
and will confuse. If you need a link for something, use a link. You
can always add another element around it and add a click listener to
this one using event delegation[1]. This'll allow keyboard users and
those without JS to follow the link (and that includes search engine
bots!) and others to click the parent element, too.

HTH
Chris

[1] http://icant.co.uk/sandbox/eventdelegation/

--
Chris Heilmann
Book: http://www.beginningjavascript.com
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/