W3C home > Mailing lists > Public > www-html@w3.org > June 2003

Re: xhtml and javascript

From: Jens Meiert <jens.meiert@erde3.com>
Date: Sun, 29 Jun 2003 01:34:44 +0200 (MEST)
To: Tom Gilder <tom@tom.me.uk>
Cc: www-html@w3.org
Message-ID: <13902.1056843284@www9.gmx.net>

> It's easy to jump to the conclusion that generating markup from script
> is always an awful thing to do - but there are some cases where it's
> extremely handy.

That's right, of course; I rather referred to the example, and I often saw
really questionable use of especially JavaScript, see e.g. an example of some
T-Online PDA code:

<http://t-news.pda.t-online.de/zone/vosu/highlights.html>

Please see 'function o()' here. -- Note: This is the final status of a CeBIT
presentation (and thus frozen). I had to review these sources, and during
the project some (but not all) things were improved. Don't ask me why T-Online
decided to generate the dropdown instead of exhausting their (comfortable)
CMS.


 Jens Meiert.



> 
> On Saturday, June 28, 2003, 3:07:46 PM, Jens Meiert wrote:
> > > <p>Here is a
> > > <script>
> > > document.write("complete paragraph<");
> > > document.write("/p>");
> > > </script>
> > 
> > The silly thing is to generate markup by scripts (imagine if
> > JavaScript is disabled). 
> 
> It's easy to jump to the conclusion that generating markup from script
> is always an awful thing to do - but there are some cases where it's
> extremely handy.
> 
> Imagine if you wanted to have an element on the page that only had a
> point in existing when scripting is enabled, like, for instance, a
> checkbox that allows all links on the page to open in a new window.
> 
> If the checkbox was in the HTML as it was, then it would actually
> makes things worse for users with no scripting - they'd have a useless
> and pointless checkbox.
> 
> You could of course use the DOM to generate the checkbox, but you'd
> have to wait for onload to fire, which is a bad thing - it would mean
> the page would most likely jump down when the checkbox was inserted,
> and if for some freak reason the page didn't ever load (an endlessly
> loading image, for example), then the checkbox would never appear.
> 
> -- 
> Tom Gilder, http://tom.me.uk/
>  Blog! http://blog.tom.me.uk/
> 
> 


-- 
Jens Meiert

Steubenstr. 28
D-26123 Oldenburg

Mobil +49 (0)175 78 4146 5
Telefon +49 (0)441 99 86 147
Telefax +49 (0)89 1488 2325 91

Mail <jens@meiert.com>
Internet <http://meiert.com>
Received on Saturday, 28 June 2003 19:34:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:55 GMT