Melissa M ***通过Developersdex发送 http://www.developersdex.com *** 不要只参加USENET ......获得奖励!Ok - I''ve been able to simplify this and still get the error.Again I have three lines:<SCRIPT language="JavaScript">varmybody=document.getElementsByTagName("body").item( 0);mytable=document.createElement("TABLE");</SCRIPT><SCRIPT language="JavaScript">WriteProductList(mytable,<%=iarrMax%>);</SCRIPT><SCRIPT language="JavaScript">mybody.appendChild(mytable); </SCRIPT>Here is the code for WriteProductList:function WriteProductList(mytable, iarrMax) {var mytablebody;var newrow;var newcell;var currenttext;mytable.setAttribute("width","100%");mytable.setAttribute("border","1");mytable.setAttribute("id","productselect");mytablebody=document.createElement("TBODY");newrow=document.createElement("TR");//Familynewcell=document.createElement("TD");currenttext=document.createTextNode("Family");newcell.appendChild(currenttext);newrow.appendChild(newcell);newrow.appendChild(newcell);mytablebody.appendChild(newrow);mytable.appendChild(mytablebody);}It''s very simple in that it writes one row to the table.Let me say that I am getting my row in the table.But as soon as it gets to the "mybody.appendChild(mytable);" part, theerror appears. And without it, I don''t get the row.Does anyone see something obviously wrong?Thank you.Melissa M*** Sent via Developersdex http://www.developersdex.com ***Don''t just participate in USENET...get rewarded for it! 这篇关于将数据动态添加到现有表格时出现问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-24 13:28