Forum Moderators: open

Message Too Old, No Replies

Changing content in div tags

Dynamic content in div tags

         

m3cheng

1:47 pm on Sep 11, 2002 (gmt 0)

10+ Year Member



My page has a div tag which loads up its content when the page is first loaded or when a drop down box has changed. I have used innerHTML in IE and document.layers[div_name] in NS for changing the content dynamically. Everything works fine until I try to get the page to run on Netscape 6.2.3.. The content of the div tag isn't showing up even when the page is first loaded... Any idea?

Thanks,
Mandy

m3cheng

2:06 pm on Sep 11, 2002 (gmt 0)

10+ Year Member



Correction.. I am using Netscape 7.0...

c3oc3o

2:29 pm on Sep 11, 2002 (gmt 0)

10+ Year Member



Mozilla/N6+ knows innerHTML, so the error must be somewhere else in your script (or maybe your browser checking gives N6+ the N4 sourcecode?).
[mozilla.org...]

m3cheng

2:56 pm on Sep 11, 2002 (gmt 0)

10+ Year Member



Thanks c3oc3o! I was actually missing the document.getElementId() calls before changing the innerHTML (though I thought I did)... but surprisingly, other IE and NS work fine even without calling this method... =)

Purple Martin

11:25 pm on Sep 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



document.getElementById is supported by the following browsers:

N6.x, N7.x, IE5.x, IE6.x

document.layers is supported by only this browser:

N4.x

document.all is supported by the following browsers:

IE4.x, IE5.x, IE6.x

The way of the future lies with document.getElementById, so use this as your default for all modern browsers, and sniff for N4.x (use document.layers) and IE4.x (use docment.all).