W3C home > Mailing lists > Public > w3c-wai-gl@w3.org > July to September 2004

RE: Scripting Techniques first draft

From: <Becky_Gibson@notesdev.ibm.com>
Date: Tue, 14 Sep 2004 14:32:29 -0400
To: <w3c-wai-gl@w3.org>
Message-ID: <OF0D0B1D8F.C33B20A2-ON85256F0F.00657F0B-85256F0F.0065CD09@notesdev.ibm.com>
Regarding document.write():

<Yvette wrote>
Personally, I have found document.write a very useful technique in 
creating
accessible websites that transform gracefully. If I create additional
features in a website that require Javascript, I always make sure to
document.write them. For example: if I create a hyperlink that increases 
the
fontsize or swaps the stylesheet, I always document.write that link so it
will only appear if Javascript is enabled. This ensures that people who do
not have Javascript are not confronted with a confusing link that doesn't
work. 
</Yvette>

<Becky's response>
We need to be careful about document.write() as it is not supported in 
XHTML.  See http://www.w3.org/MarkUp/2004/xhtml-faq.   Item #14 states:
Does document.write work in XHTML?
No. Because of the way XML is defined, it is not possible to do tricks 
like this, where markup is generated by scripting while the parser is 
still parsing the markup.
You can still achieve the same effects, but you have to do it by using the 
DOM to add and delete elements.
</becky>

-becky





Becky Gibson
Web Accessibility Architect
                                                       
IBM Emerging Internet Technologies
5 Technology Park Drive
Westford, MA 01886
Voice: 978 399-6101; t/l 333-6101
Email: gibsonb@us.ibm.com
Received on Tuesday, 14 September 2004 18:32:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:17:58 UTC