Client-side scripting used with HTML and XHTML
This technique relates to:
- Success Criterion 2.4.4: Link Purpose (In Context) (Sufficient as a way to meet an unwritten technique)
- Success Criterion 2.4.9: Link Purpose (Link Only) (Sufficient as a way to meet an unwritten technique)
The purpose of this technique is to allow users to choose to have additional information added to the text of links so that the links can be understood out of context.
Some users prefer to have links that are self-contained, where there is no need to explore the context of the link. Other users find including the context information in each link to be repetitive and to reduce their ability to use a site. Among users of assistive technology, the feedback to the working group on which is preferable has been divided. This technique allows users to pick the approach that works best for them.
A link is provided near the beginning of the page that will expand the link text of the links on the page so that no additional context is needed to understand the purpose of any link. It must always be possible to understand the purpose of the expansion link directly from its link text.
This technique expands the links only for the current page view. It is also possible, and in some cases would be advisable, to save this preference in a cookie or server-side user profile, so that users would only have to make the selection once per site.
Working example of this code: Providing link expansions on demand.
- Check that there is a link near the beginning of the page to expand links
- Check that the link identified in step 1 can be identified from link text alone
- Find any links on the page that cannot be identified from link text alone
- Activate the control identified in step 1
- Check that the purpose of the links identified in step 3 can now be identified from link text alone
- Checks #1, #2, and #5 are true