Javascript and Accessibility

后端 未结 6 461
南旧
南旧 2021-02-01 19:14

As a web developer, a number of the projects I work on fall under government umbrellas and hence are subject to 508 Accessibility laws, and sometimes W3C accessibility guideline

6条回答
  •  清酒与你
    2021-02-01 19:28

    I think the accepted answer, while fine for its time, is now out of date. (Literally a decade old at time of writing this answer. WCAG 2.1 was finalized a few weeks ago...)

    The W3C WAI-Authoring Design Patterns Practices document includes various examples of common widgets which require javaScript in order to communicate the right semantics, states and roles to assistive technologies.

    AJAX can be made accessible, as long as you are careful to give screenreaders relevant semantic clues about what the in-page-update will be before the user activates it. You may also need to notify the screenreader about what actually changed afterwards, e.g. an aria-live region might announce "20 new items have been loaded" or whatever. This is achieved with javaScript.

    If your accessibility knowledge stops at 'progressive enhancement', and you see the accepted answer above as rationale for that position, then you may well be in need of an update. Things are moving fast these days.

提交回复
热议问题