WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: How to Review JavaScript Results

for

Number of posts in this thread: 2 (In chronological order)

From: Randy Pearson
Date: Thu, Aug 12 2004 8:56AM
Subject: How to Review JavaScript Results
No previous message | Next message →


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

From: Chris Heilmann
Date: Thu, Aug 12 2004 9:04AM
Subject: Re: How to Review JavaScript Results
← Previous message | No next message



> 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.


There are several bookmarklets for that
http://www.codehouse.com/javascript/favelets/dhtml_snoop/

Personally I use Mozilla for Javascript development and debugging, partly
because of the amazing web developer toolbar, that also shows the source
of a highlighted element (including DOM generated code), but also because
of venkman, the javascript debugger.

http://www.chrispederick.com/work/firefox/webdeveloper/

HTH
Chris

--
Chris Heilmann
The mighty pen: http://icant.co.uk/
Learn to let go! http://ltlg.icant.co.uk
Binaries: http://www.onlinetools.org/