WebAIM - Web Accessibility In Mind

E-mail List Archives

How to Review JavaScript Results

for

From: Randy Pearson
Date: Aug 12, 2004 8:56AM



Does anyone know of a tool that lets you view the source in a way that shows
the *result* of any JavaScript that has transformed the page?

As a simple example, suppose your page included:


document.write('');


If one simply uses their browser's View Source function, they will see the
above script. What I would like to see is the literal result of the HTML.
Why? Well the above script has multiple flaws, most notably the lack of an
ALT attribute for the IMG tag.

Obviously, something like the above example is easy to spot (I wonder if any
accessibility checking tools would spot it, however). But consider a large
JS-based menu system that writes and manipulates lots of your page including
aboslute positioning, CSS, etc. How can you easily review the literal
results in order to perform a quality assurance check on the code?

Using MSIE's implementation of the DOM doesn't help, because that doesn't
show you the original (potentially offending) source, but rather the result
of MSIE's interpretation of it. So, if you were looking for, say, missing
closing tags or some such, you couldn't count on something like that.

Note: I realize accessibility guidelines require the page to be accessible
when JS is disabled. My question concerns strictly the review of impact on a
page when JS is running.

Thanks,

-- Randy