JRS: In article <Xn********************@194.109.133.29>, dated Wed, 17
Nov 2004 08:25:39, seen in news:comp.lang.javascript, Evertjan.
<ex**************@interxnl.net> posted :
Dr John Stockton wrote on 16 nov 2004 in comp.lang.javascript: document.getElementById("div1").innerHTML="Hello"
Thanks, it does exactly what I needed,
In most but not all browsers - see FAQ, 4.15.
While this is true, John,
the OP clearly shows a to be a newbee,
and a complete solution would scare the OP off,
which is worse IMHO, than the incompliance.
btw: Having javascript switched off could be
a far more probable problem,
than having a innerHTML incompliant browser.
It is not for us to decide what the reader is allowed to know; it is for
the reader to decide what he needs to support, knowing that the solution
you gave is not universal. A reference to the FAQ achieves that
warning.
So does "Older browsers may not know getElementById; it can be provided
if needed by
if (document.all && !document.getElementById) {
document.getElementById = function(id) {
return document.all[id] } } // "
// (which seems OK to me, and works in IE4.)
Moreover, since he *is* asking about something which the FAQ answers,
then he should in any case be referred to the FAQ; he may very well find
there answers to future questions.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.