Does compliance to WCAG 2.0 AA prevent the use of JavaScript?

谁都会走 提交于 2019-11-30 18:22:07

The short answer is, no, it doesn't. Your understanding is pretty much correct.

Clayton

A slightly longer answer is that pages can require JavaScript (AKA ECMAScript), but it's better if they don't. Use JavaScript sparingly and carefully. There's a set of guidelines for using JavaScript on WCAG 2.0 compliant pages.

Indeed, you can use JavaScript as long as we you abide by WCAG 2.0 success criteria :-)

There is a rationale why you may have heard JavaScript is banished from accessible content. In the old days of WCAG 1.0, it practically censured the use of any content generated by JavaScript. You needed to check that your web application still worked with JavaScript disabled, which practically restricted JavaScript to decorative purposes. Otherwise, you ought to provide an alternate, non-JavaScript reliant, version, which usually involved a lot of server-side magic (try and see Google Maps without JS to understand what I mean). This was because in those old days assistive technologies and even some mainstream browsers (e.g. mobile) did not support JavaScript, or browsers did not expose script-generated contents.

This is not the case anymore. You can use JavaScript in accessible, WCAG 2.0, websites, but:

  • Get acquainted with WCAG 2.0 criteria and make sure you are not failing any of them. It is not a matter of using one or another technology, but a matter of using them correctly.
  • In particular, check you abide by the client-side scripting techniques for WCAG 2.0 which deal with recommended and disapproved scripting usages.
  • Use ARIA Techniques for WCAG 2.0 to define the semantics of non-standard controls, they are widely supported by major browsers.
Lisa Seeman

You can use JavaScript. It is not a problem so long as all semantics are provided (name, state, and role) and you manage the focus accessible. Use ARIA when you need to provide semantics or manage focus.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!