[Javascript] document.all for NETSCAPE

Hassan Schroeder hassan at webtuitive.com
Tue Oct 12 18:27:08 CDT 2004


dev at qroute.net wrote:

> window.document.all.myDivision.innerHTML = 'ABC'
> 
> WHAT'S THE ALTERNATIVE TO THIS SO IT IS COMPLAINT IN NETSCAPE BROWSERS ? 

If you mean recent Mozilla-based browsers, try

document.getElementById("myDivision").appendChild(document.createTextNode("ABC")) 


Note: Moz supports the MS-proprietary innerHTML but *only* in pages
served as mime-type "text/html"; in XHTML pages served properly as
"application/xhtml+xml", innerHTML will *not* work.

On the other hand, using the DOM properly as above will also work in
IE, so you're already ahead :-)

FWIW!
-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.





More information about the Javascript mailing list