javascript insertBefore() difficulties -


i trying add rows table dynamically. working fine following code:

var tableadd = document.getelementbyid(tablechoice); var lastrow = tableadd.getelementsbytagname('tr').length; var clonerow = document.getelementbyid(rowid + '1'); var newrow = clonerow.clonenode(true); newrow.id = rowid + lastrow; tableadd.appendchild(newrow); 

however, because of way designed, leaves gap between , corresponding rows in rendered html. space hidden row copy without copying "data" inside it.

the solution came send whitespace below inserting cloned row above hidden "template" row using code below:

var tableadd = document.getelementbyid(tablechoice); var lastrow = tableadd.getelementsbytagname('tr').length; var clonerow = document.getelementbyid(rowid + '1'); var newrow = clonerow.clonenode(true); newrow.id = rowid + lastrow; tableadd.insertbefore(newrow,clonerow); 

and searching have done, should work....except doesn't. freezes application , throws cryptic error:

0x800a139e - javascript runtime error: notfounderror 

any on doing wrong?


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -