February 19th, 2006, 07:49 AM
Node cannot be inserted at the specified point in the hierarchy
can someone point out the error in my ways with the script at http://www.alphaworks.co.uk/test/add2.html ?
It gives a "Node cannot be inserted at the specified point in the hierarchy" error relating to line 26.
I can't see what I'm doing wrong, it would seem a valid thing to do. I've searched on the error but can't see anything which applies to my problem.
February 19th, 2006, 09:16 AM
Look carefully at your newTD function. What are you creating and returning from there? Oops!
Hope this helps,
February 19th, 2006, 10:14 AM
It may be because the parentNode is not what think.
Add ... I'm pretty sure you're going to get TBODY.
// This is what the browser assumes as the table hierachy
// even if you don't include the thead, tbody, or tfoot tags
February 23rd, 2006, 04:10 PM
Very helpful, silly mistake!
Originally Posted by jerom
February 23rd, 2006, 04:11 PM
Originally Posted by jsKid
while you're right about the parentNode of the <tr> element being <tbody> and not <table> I don't think this actually caused the problem in this case. I have changed the names of the variables to match this though.