HighDots Forums  

html DOM - insertBefore problem

alt.html.dhtml alt.html.dhtml


Discuss html DOM - insertBefore problem in the alt.html.dhtml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
e michael brandt
 
Posts: n/a

Default html DOM - insertBefore problem - 02-10-2006 , 11:33 AM






I am frustrated. It appears that one can not use insertBefore to insert
an A node before a DL node. Is that really true?

I *am* able to insert before a <p id="hh"> tag, but not before a <dl
id="hh"> tag.

i am also able to do a body.appendChild with no trouble.

Finally, winIE6 pops an error: 'Invalid argument' at the last snip line
below:

A snip from my code:

****
var newA = document.createElement("A");

var refObj=document.getElementById("hh");

//document.body.appendChild(newA); //works fine
document.body.insertBefore(newA,refObj);// winIE6 error: 'Invalid argument'
****

Any ideas why this is happening Is it me? or is there some rule I've
not been able to find?

Thanks for any help.

P.S. Same problem if I use "div1", a div wrapper around the dl node,
instead of body node.

emichael b.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.