"Eric" <um**@psyon.org> writes:
Please keep a little of the post you are answering so we can see wha
you refer to.
Right -- but DOM2 isn't universally supported (not that javascript is -- but
I wanted to do a little bit better than IE5).
What does IE5 do, and what would be better?
Is this my only option?
(the one in the FAQ?)
It is a *good* option. It works in IE4+, NS6+ and Opera 7.
The code is not very pretty, though. Try this instead:
---
function writeHTML(id,S) {
var elem = (document.getElementById ? document.getElementById(id) :
(document.all ? document.all[id] : undefined));
if (!elem) { return false; }
elem.innerHTML = S;
return true;
}
---
It works in any browser that understands .innerHTML. Adding support
for NS4 requires some extra work, but is possible if the element
to write into is absolutely positioned.
I don't know what other browsers are out there that allows changing
the contents of the page dynamically.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'