J
Janis Papanagnou
This is partly a repost that was maybe too buried to be seen. Sorry for
that. I thought it would be an easy to be answered question, but I may be
wrong...
I wanted to _insert_ cloned table row into the same table, and while using
appendChild() worked fine insertBefore() - which is what I actually need -
resulted in an error.
This code works...
active_row = document.getElementById ("Active_Row")
cloned_row = active_row.cloneNode (true)
document.getElementById ("Table").appendChild (cloned_row)
But trying to insert it before active_row with this code failed[*]...
active_row = document.getElementById ("Active_Row")
cloned_row = active_row.cloneNode (true)
document.getElementById ("Table").insertBefore (cloned_row, active_row)
What's wrong with that code? Any insights greatly appreciated!
Janis
[*] The error messages in the Javascript console:
Error: uncaught exception: [Exception... "Node was not found"
code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)"
location: "file:... Line: 390"]
that. I thought it would be an easy to be answered question, but I may be
wrong...
I wanted to _insert_ cloned table row into the same table, and while using
appendChild() worked fine insertBefore() - which is what I actually need -
resulted in an error.
This code works...
active_row = document.getElementById ("Active_Row")
cloned_row = active_row.cloneNode (true)
document.getElementById ("Table").appendChild (cloned_row)
But trying to insert it before active_row with this code failed[*]...
active_row = document.getElementById ("Active_Row")
cloned_row = active_row.cloneNode (true)
document.getElementById ("Table").insertBefore (cloned_row, active_row)
What's wrong with that code? Any insights greatly appreciated!
Janis
[*] The error messages in the Javascript console:
Error: uncaught exception: [Exception... "Node was not found"
code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)"
location: "file:... Line: 390"]