javascript added elements in div not showing in ie

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • glin@tollnz.co.nz

    #1

    javascript added elements in div not showing in ie

    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.

  • Zifud

    #2
    Re: javascript added elements in div not showing in ie

    glin@tollnz.co. nz wrote:[color=blue]
    > 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?
    >[/color]

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


    --
    Zif

    Comment

    • madtom1999@yahoo.com

      #3
      Re: javascript added elements in div not showing in ie


      Zifud wrote:[color=blue]
      > glin@tollnz.co. nz wrote:[color=green]
      > > Hi all,
      > >
      > > I have a javascript that create table and field elements[/color][/color]
      dynamically in[color=blue][color=green]
      > > 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,[/color][/color]
      why?[color=blue][color=green]
      > >[/color]
      >
      > At a guess because IE doesn't like your code.
      >
      >
      > --
      > Zif[/color]
      if you are useing document.getEle mentId 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.

      Comment

      • Zifud

        #4
        Re: javascript added elements in div not showing in ie

        madtom1999@yaho o.com wrote:[color=blue]
        > Zifud wrote:
        >[color=green]
        >>glin@tollnz.c o.nz wrote:
        >>[color=darkred]
        >>>Hi all,
        >>>
        >>>I have a javascript that create table and field elements[/color][/color]
        >
        > dynamically in
        >[color=green][color=darkred]
        >>>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,[/color][/color]
        >
        > why?
        >[color=green]
        >> At a guess because IE doesn't like your code.
        >>
        >>
        >>--
        >>Zif[/color]
        >
        > if you are useing document.getEle mentId 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.
        >[/color]

        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?

        --
        Zif

        Comment

        • Dietmar Meier

          #5
          Re: javascript added elements in div not showing in ie

          glin@tollnz.co. nz wrote:
          [color=blue]
          > 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?[/color]

          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

          Comment

          • Michael Winter

            #6
            Re: javascript added elements in div not showing in ie

            madtom1999@yaho o.com wrote:

            [snip]
            [color=blue]
            > if you are useing document.getEle mentId then you may need to set the
            > page into compatability mode for IE6 to work[/color]

            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.
            [color=blue]
            > or detect the browser type and use document.all instead.[/color]

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

            document.getEle mentsByTagName( '*')

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

            Mike

            --
            Michael Winter
            Replace ".invalid" with ".uk" to reply by e-mail.

            Comment

            • glin@tollnz.co.nz

              #7
              Re: javascript added elements in div not showing in ie

              thanks guys, I don't have tbody in html.

              Comment

              Working...