WebAIM - Web Accessibility In Mind

E-mail List Archives

Is any use of document.write a violation of WCAG 2.0 1.3.1 (or only if it is used to dynamically create new content after the page has loaded)?

for

From: Glenda Sims
Date: Feb 1, 2012 6:09PM


Oh wise and wonderful Accessibility Experts,

I'm pretty sure I know the answer to this question...but I need to make
sure I'm accurate by getting some 2nd opinions. I believe that the use of
document.write is perfectly acceptable and meets WCAG 2.0 1.3.1
requirements....when it is used to build a web page, as the page is loading
the first time.

Now, if you start using document.write after the page has fully loaded, to
dynamically change content on the page, then, you can get in trouble and be
out of compliance with WCAG 2.0 1.3.1.

The item I'm trying to clarify is down at the bottom of the Testing Technique
in SCR21: Using functions of the DOM to add content to a page at
http://www.w3.org/TR/2012/NOTE-WCAG20-TECHS-20120103/SCR21

Is specifically states:

Tests
> Procedure
> For pages that dynamically create new content:
>
> 1. Examine the source code and check that the new content is not
> created using document.write(), innerHTML, outerHTML, innerText or
> outerText.
>
>
> End of Quote.

Now, in my humble opinion, the key word in this procedure is "new". I
think you can't use document.write to add new content to the page.

So now, it is time for me to listen to your opinions. How do you interpret
this? Do you agree with me? Or not.

Thanks tons,
Glenda (goodwitch) Sims
--
glenda sims | deque.com | 512.963.3773

*web for everyone. web on everything.* - w3 goals