• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[Resolved] appendChild not working in IE

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following code...



In firefox, works great. In IE I get no errors but I get no LI on the given UL. Any ideas? I've confirmed that in IE both ul and li are an [object].
[ March 14, 2006: Message edited by: Pat Denton ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Works fine for me. What's e?
 
Pat Denton
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
e is some text passed into the function. I've also confirmed that e has a value.

Works fine for me

Figures.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This works for me:



It may be because e can mean something to IE so it probably would be best not to use it. Not sure if that would be the case since I was able to do it in my IE. Make sure you are not cached either and you are calling it after the UL element is rendered on the page.

Eric
 
Pat Denton
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the UL's are being created dynamically as well. But they are all created and are visible on the page before this code gets called. I am calling this code when clicking on a checkbox.

I changed e to something else and it still fails in IE. Eric's example works fine for me in IE. Something just hit me. Each UL is in it's own TD. I wonder if for some reason, in IE, when I add a child to the UL, the TD is not expanding it's height? I don't know, just shooting in the dark here.
 
Pat Denton
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wonder if for some reason, in IE, when I add a child to the UL, the TD is not expanding it's height?

Nope, that's not it either.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or it could be that IE is not adding the IDS to the ul.

Do yourself a little test to see if the id is actually added to the elements. Do it by alerting the innerHTML after you append the element.

Eric
 
Pat Denton
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Figured it out. I forgot that when creating tables in js you have to give the table a tbody or anything between the thead and tfoot won't render in IE. Thanks for the help though.
 
reply
    Bookmark Topic Watch Topic
  • New Topic