javascript added elements in div not showing in ie

G

glin

Hi all,

I have a javascript that create table and field elements dynamically in
a hidden div, and when I trigger to display the div, the elements I
created in div does not show in ie, but it works fine on firefox, why?

Thanks.
 
Z

Zifud

Hi all,

I have a javascript that create table and field elements dynamically in
a hidden div, and when I trigger to display the div, the elements I
created in div does not show in ie, but it works fine on firefox, why?

At a guess because IE doesn't like your code.
 
Z

Zifud

dynamically in


if you are useing document.getElementId then you may need to set the
page into compatability mode for IE6 to work - or detect the browser
type and use document.all instead.

Or it could be adding table elements using innerHTML, or it could be
adding table elements to the table, not the body, or it could be a
conflict in the HTML that is tolerated by Firefox but not IE, or it
could be...

The OP didn't bother to post code or even hint at the method used to
create the new elements, so how accurate will any guess at a solution
be?
 
D

Dietmar Meier

I have a javascript that create table and field elements dynamically
in a hidden div, and when I trigger to display the div, the elements I
created in div does not show in ie, but it works fine on firefox, why?

Probably you did not create a TBODY element, and tried to add TR elements
to a TABLE element instead of adding it to a TBODY element, what MSIE
silently ignores.

ciao, dhgm
 
M

Michael Winter

(e-mail address removed) wrote:

[snip]
if you are useing document.getElementId then you may need to set the
page into compatability mode for IE6 to work

Not at all. Though IE's implementation of most DOM methods (including
gEBI) is contrary to specification in both Standards and Quirks mode, it
"works" in both nevertheless.
or detect the browser type and use document.all instead.

The all collection should be all but deprecated in IE except for IE4,
and IE5.x as a replacement for

document.getElementsByTagName('*')

In this latter case, IE5.x doesn't recognise an asterisk (*) as a value,
which matches all elements.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,616
Members
45,305
Latest member
KetoMeltsupplement

Latest Threads

Top