Welcome to WebHeadStart.org

Web Technologies

Sponsored By

WebHeadStart.org is currently in beta.
Please pardon our appearance as we work to provide you with the most comprehensive reference on today's web technologies.

Interested in advertising on WebHeadStart? Become an advertising partner today!

[WWW-HTML Mailing List Archive Home] [Messages By Thread] [Messages By Date]

Re: xhtml and javascript

From: Tom Gilder <tom@tom.me.uk>
Date: Sat, 28 Jun 2003 23:52:49 +0100
Message-ID: <4554396890.20030628235249@tom.me.uk>
To: www-html@w3.org

On Saturday, June 28, 2003, 10:18:11 PM, Ian Hickson wrote:
> On Sat, 28 Jun 2003, Tom Gilder wrote:
> > 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
> 
> You shouldn't need to:
>
>    <div id="hook"></div>
>    <script type="application/x-javascript">
>      var element = document.createElement('INPUT');
>      document.getElementById('hook').appendChild(element);
>    </script>

That should work, yes, but sadly IE/win is extremely buggy (and I
think I had problems with another browser at some point too, but my
mind has gone blank) with modifying the DOM before it's all loaded.
Often it comes up with "unknown runtime error" or just stops loading
the document full stop.

It's *much* safer in my experience to use document.write (when using
HTML, anyway). Using DOM to generate a lot of content can also get
extraordinarily messy after a while.

-- 
Tom Gilder, http://tom.me.uk/ 
 Blog! http://blog.tom.me.uk/ 
Received on Saturday, 28 June 2003 18:52:59 GMT
Valid XHTML 1.0! Valid CSS! Site Map | Privacy Policy | Terms of Use | WebHeadStart.org © 2005 All Rights Reserved.