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

后端 未结 4 2388
梦如初夏
梦如初夏 2021-02-19 09:52

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

My understanding based on Understanding Conformance is that we can still use JavaScript as long as

4条回答
  •  孤城傲影
    2021-02-19 10:26

    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.

提交回复
热议问题