1

So I am reworking an old project I did. It worked fine in Chrome but in IE it doesn't work so well. It basically dynamically creates selects, then on the final one spits out the choices selected and a somewhat humorous response. But in IE it freaks out and throws me a "SCRIPT5022: DOM Exception: HIERARCHY_REQUEST_ERR (3) " does anybody know what is wrong with it? Any help is appreciated.

here is the site http://goo.gl/WcSqJ

SalmonMode
  • 281
  • 6
  • 17
  • Possible duplicate of [What exactly can cause an “HIERARCHY_REQUEST_ERR: DOM Exception 3”-Error?](http://stackoverflow.com/q/1256394/843985). – scessor Feb 20 '12 at 14:10

1 Answers1

0

HIERARCHY_REQUEST_ERR code 3

This node is not allowed to have children of the new node's type, or the new node is already an ancestor of this node; for example, attempting to append an Element node to a Text node. For more information visit this.

The Alpha
  • 143,660
  • 29
  • 287
  • 307
  • Ok. So whats the best way to fix it? – SalmonMode Feb 20 '12 at 14:40
  • Can you please post some relevant code that are being used to generate your dynamic element. – The Alpha Feb 20 '12 at 15:29
  • pEle.appendChild(xmlDocTemp.getElementsByTagName('answer')[id.charAt(i)].childNodes[0]); is the line im getting the issue at – SalmonMode Feb 20 '12 at 16:00
  • This is not enough to find out the problem but what I can see now is that, getElementsByTagName('answer') is not correct because answer is not a valid html tag, it should be using a valid html tag like "div", "p" e.t.c. and what is charAt(i), looks like a loop's counter, if possible please post more code, so I can see what and how pEle and other objects are connected to each other. – The Alpha Feb 20 '12 at 16:08
  • Is this being generated from an xml file ? – The Alpha Feb 20 '12 at 16:14
  • I think it's ( getElementsByTagName('answer') ) ok if it's being generated from an xml file. – The Alpha Feb 20 '12 at 16:17
  • yea. thats why i was linking to the page itself. There is a few xml files that i pull things from and 'answer' is one of those tags – SalmonMode Feb 20 '12 at 16:32
  • Which version of ie displays the errors ? I've found 5 errors till now in your script. – The Alpha Feb 20 '12 at 16:40
  • so far ive only been able to test 9 – SalmonMode Feb 20 '12 at 18:50
  • 1
    Can you replace your appendChild methods with innerHtml=someitem; it could solve your problem, hopefully. – The Alpha Feb 21 '12 at 06:32