6

WCAG 2.0 has some requirements on robustness: "Content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies", but it doesn't mention JavaScript explicitly.

Now I have a project where I have to meet WCAG 2.0 recommendations. Do I have to support browsers / user agents which don't support JavaScript?

  • Cross-side duplicate of stackoverflow.com/questions/8383151/… – rink.attendant.6 Jul 27 '15 at 9:12
  • @rink.attendant.6 that's loosely connected at best. You've referenced whether the use Javascript breaches Level AA compliance in comparison to Zsolt's question of whether browsers that don't have Javascript / have it turned off would meet Guideline 4.1 of Level A compliance. – Clint Jul 27 '15 at 9:29
  • Also @Zsolt what level of accessibility do you need to meet? Level A, AA or AAA? – Clint Jul 27 '15 at 9:44
  • @Clint, I have to meet Level AA, but since even Level A has a restriction on that, it doesn't matter. – Zsolt Jul 27 '15 at 11:43
  • I understand that @Zsolt :) it's just good to provide that additional context in the question just in case someone else can provide additional insight – Clint Jul 27 '15 at 12:12
1

Short answer (and to avoid delving into how you are planning to parse content on your website) is yes it does mention javascript - http://www.w3.org/TR/UNDERSTANDING-WCAG20/ensure-compat.html

If the Assistive Technology can't interpret your content correctly when Javascript is turned off on your page (or the web browser being used doesn't support Javascript) then it would not be meeting Level A accessibility requirements.

  • Thank you, I also thought this when I read the recommendation, but it's better if someone confirms this. :) – Zsolt Jul 27 '15 at 11:42
  • Not a problem @Zsolt :) you can accept the answer if you like to make sure it doesn't hang as unanswered (unless you think there is a different answer of course). – Clint Jul 28 '15 at 6:59
  • Actually the answer "yes it does" is wrong: The linked page doesn NOT mention JavaScript explicity. – Andy Jun 19 at 13:34
3

Both are good answers, when taken together, but both are sort of wrong in some respects too. WCAG is technology agnostic so it is not going to say what technologies (such as javascript) must be supported.

The key thing, which @daniel alluded to, is that whatever html gets generated, whether JS is enabled or not, must be semantically correct so that assistive technology (such as a screen reader or braille device or screen magnifier) can understand it.

If you have important elements of your UI that are created on the fly in JS, and JS is turned off, then your page might not be accessible to some users, so in that respect, you would have to support a non-JS browser, but only because of the way you coded your page. If all the important elements are there without using JS, then you'd be ok. So it's not really a statement of whether non-JS browsers need to be supported, it's whether your html will be complete and usable without JS.

Update: November 14, 2018

Great discussion in the comments. It's a simple question but a complicated answer. I've read the conformance guidelines at least a dozen or more times thinking about this post (and thus delaying my reply).

@TripeHound touched on a key point,

If insisting on JS for the site to work is acceptable, and you pass WCAG with JS enabled, then everything is OK.

as did @Daniel,

if JS is disabled but it passes all criteria when JS is enabled (ha! Never happens)

that if the JS-supported page conforms to WCAG, then you can state that you rely on JS and you would not have to support a non-JS page. But again, that's only if your resulting JS page was conformant. If it was not conformant, then you would have to support a non-JS version.

So the short answer is the dreaded "it depends".

It's also worth reading WebAIM's take on this subject.

While WCAG 1.0 from 1999 required that pages be functional and accessible with scripting disabled, WCAG 2.0 and all other modern guidelines allow you to require JavaScript, but the scripted content or interactions must be compliant with the guidelines.

WebAIM's statement helps, but it's not authoritative. Certainly their opinion is based upon the guidelines, but just because someone states something, it doesn't make it true. Fortunately, if you read (and re-read) the conformance guidelines, in particular requirement #5, I think WebAIM's statement says the same thing but in plainer English.

And they have a somewhat expected qualifier:

If your web page or application requires scripting, ensure that you account for users without JavaScript. While this does not necessarily mean that all functionality must work without scripting (though this would clearly be optimal), if it does not work without scripting, you must avoid a confusing or non-functional presentation that may appear to function, but does not because of lack of JavaScript support.

This qualifier is somewhat alluded to in my original answer.

Given that the OP is 3 years old, I'm not sure anyone (other than us 3 :-)) will see this discussion. But I learned something.

  • So a government client comes to me with an SPA they built and asks me to do an accessibility audit on it. It legally needs to pass WCAG 2.0. It shows a blank page if JS is disabled but it passes all criteria when JS is enabled (ha! Never happens). Do I fail them? If I do, what do I point to in the WCAG guidelines to prove that it fails from a legal standpoint? – Daniel Tonon Nov 11 '18 at 20:46
  • 1
    @DanielTonon Surely that question is somewhat pointless... if the site is blank without JS, then nobody can use it, whether or not they normally use screen-readers or other assistive technologies. If insisting on JS for the site to work is acceptable, and you pass WCAG with JS enabled, then everything is OK. If insisting on JS is not acceptable, then you need to develop a non-JS version anyway (but should ensure it meets WCAG as you do). – TripeHound Nov 12 '18 at 14:33
  • It is not possible to make a Single Page App accessible with JS disabled. If WCAG compliance is a legal requirement and to be officially WCAG compliant you MUST support JS, then the government will never be legally allowed to build an SPA for anything. That is what the core of this question is. If it is a legal requirement, is no JS support mandatory? If so, SPA's will forever be illegal. – Daniel Tonon Nov 12 '18 at 20:09
  • I get what you are saying. No non-JS support will obviously exclude users that have JS disabled and thus is inaccessible to those users. It isn't a question about weather it is literally accessible or not. It is a question about what the minimum legal requirement for WCAG support is. – Daniel Tonon Nov 12 '18 at 20:19
1

Technically, from a legal stand point, no you do not need to support JS disabled users to pass accessibility.

Clint referenced 4.1 "Compatible" in his answer.

The actual guidelines for that section are 4.1.1 and 4.1.2.

4.1.1 is all about making sure your HTML is valid. Put your HTML through a HTML validator and if it passes, you're good to go.

4.1.2 is about using roles and aria attributes and stuff correctly.

Neither guideline states that the site needs to work with JS disabled.

There is this quote from 4.1 "Compatible" under the heading "Advisory Techniques for Guideline 4.1":

  • Not displaying content that relies on technologies that are not accessibility-supported when the technology is turned off or not supported.

That would suggest that no-JS support is required to pass accessibility however the block of text above that dot point says this:

These techniques are not required or sufficient for meeting any success criteria, but can make certain types of Web content more accessible to more people.

Therefore no-JS support is certainly encouraged but it is not required to pass any form of WCAG accessibility from a legal standpoint.

You can render an empty html page with JS disabled and as long as it is valid HTML, it technically does not even fail WCAG AAA level accessibility requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.