POV-Ray : Newsgroups : povray.off-topic : More web madness : Re: More web madness Server Time
3 Sep 2024 19:17:24 EDT (-0400)
  Re: More web madness  
From: Orchid XP v8
Date: 23 Sep 2010 15:39:13
Message: <4c9bace1$1@news.povray.org>
>> Well, that's very nice, but as far as I can see, there's no equivalent
>> way of doing what document.write does.
>
> what? like:
> var foo=document.getElementById("foo");
> var p=document.createElement("p");
> var txt=document.createTextNode("Text in the paragraph!");
> p.appendChild( txt );
> foo.appendChild( p );
>
> or something like that (it's been a while I last fiddled with DOM)...
>
> not as practical as document.write, of course...

In particular, it works *only* if you tag the place where you want the 
generated content to go, or you know enough about the static structure 
of the document to be able to navigate to it.

My usual trick is to do document.write("JavaScript is enabled."). It's a 
nice, simple way of determining whether the browser supports JS and has 
it enabled. It's also useful for not showing buttons for features that 
require JS if JS is not available...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.