removeChild Method
Removes the specified child node from the list of children and returns it.[Script] 
Script Syntax
var objXMLDOMNode = oXMLDOMNode.removeChild(childNode);
Parameters
childNode 
An object. Child node to be removed from the list of children of this node. 
Return Value
An object. Returns the removed child node.Example
The following script example creates an IXMLDOMNode object (currNode), removes a child node from it, and displays the text of the removed node.var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
var root;
var currNode;
var oldChild;
xmlDoc.async = false;
xmlDoc.load("books.xml");
root = xmlDoc.documentElement;
currNode = root.childNodes.item(1);
oldChild = currNode.removeChild(currNode.childNodes.item(1));
alert(oldChild.text);
[Visual Basic] 
Visual Basic Syntax
Set objXMLDOMNode = oXMLDOMNode.removeChild(childNode)
Parameters
childNode 
An object. The child node to be removed from the list of children of this node. 
Return Value
An object. Returns the removed child node.Example
The following Microsoft® Visual Basic® example creates an IXMLDOMNode object (currNode), removes a child node from it, and displays the text of the removed node.Dim xmlDoc As New Msxml2.DOMDocument40
Dim root As IXMLDOMElement
Dim currNode As IXMLDOMNode
Dim oldChild As IXMLDOMNode
xmlDoc.async = False
xmlDoc.Load ("books.xml")
Set root = xmlDoc.documentElement
Set currNode = root.childNodes.Item(1)
Set oldChild = currNode.removeChild(currNode.childNodes.Item(1))
MsgBox oldChild.Text
[C/C++] 
C/C++ Syntax
HRESULT removeChild(
    IXMLDOMNode *childNode,
    IXMLDOMNode **outOldChild);
Parameters
childNode [in] 
The child node to be removed from the list of children of this node. 
outOldChild [out, retval] 
The removed child node. If Null, no object is created. 
C/C++ Return Values
S_OK 
The value returned if successful. 
E_INVALIDARG 
The value returned if oldChild is not a child of this node, when the specified oldChild is read-only and cannot be removed, or when oldChild is Null. 
E_FAIL 
The value returned if an error occurs. To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button  in the upper-left corner of the page.

解决方案 »

  1.   

    主框架 目录
    <td name=1 onmousedown="check(this);">黑色金属 禁用 </td>
    <td name=2 onmousedown="check(this);">>橡胶制品 禁用 </td>
    <td name=3 onmousedown="check(this);">>油料油脂 禁用 </td>
    <td name=4 onmousedown="check(this);">>花轻产品 禁用 </td><input type=hidden name="a"><script>
    function check(id){
       document.all('a').value=this.name;
    }
    </script>
     
    左边框架
    <input type=button value="删除" onclick="test();"><script>
    function test(){
       if(self.top.frames['main']).document.all('a').value.length<1{
          alert("请选择要删除的目录");
       }else{
          var name=self.top.frames['main']).document.all('a').value;
          self.top.frames['main']).document.all(name).隐藏//此处有待完善
       }
    }
    </script>
      

  2.   

    删除一行:
    在JS中设一全局变量rowIndex,在click事件中将行数附给此变量,在确定事件中用document.all.table.deleterow(rowIndex)方法将此行删除。手型和变蓝色就不用说了吧。
      

  3.   

    注: 如果使用楼上的方法  每删除一条记录 都要刷新一下main框架里的目录页面才行!
      

  4.   

    document.all.table.deleterow(2)
    这样不可以啊,抱错,说 
    document.all.table为空或不是对象
      

  5.   

    table 是你的表格的ID号
    如你的<table id="table1">如果这样写
    javascript 中应这样document.all.table1.deleterow(2)
      

  6.   

    deleteRow注意大小写
    "table"应该是表的ID
    用document.getElementById("table").deleteRow(2)
      

  7.   


    "document.all.t1.deleterow(1);
    对象不支持该属性或方法
    <html>
    <head>
    <title>新建网页 1</title>
    </head>
    <script>
    function del()
    {
    document.all.t1.deleterow(1);
    }
    </script>
    <body>
    <form action="--WEBBOT-SELF--" method="POST" >
      <!--webbot bot="SaveResults" u-file="fpweb:///_private/form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" --><p>
      <input type="button" value="删除" name="B1" onClick="del()">
    </form>
    <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="t1">
      <tr>
        <td width="20%">ds</td>
        <td width="20%">sdf</td>
        <td width="20%">d</td>   
      </tr>
      <tr>
        <td width="20%">w</td>
        <td width="20%">s</td>
      </tr>
    </table>
    </body>
    </html>
      

  8.   

    给你删除的代码,其它的不是什么问题吧?
    <TABLE ID = oTable border=1>
    <TR onclick="this.removeNode(true)" style="cursor:hand">
    <TD>黑色金属</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="this.removeNode(true)" style="cursor:hand">
    <TD>橡胶制品</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="this.removeNode(true)" style="cursor:hand">
    <TD>料油脂</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="this.removeNode(true)" style="cursor:hand">
    <TD>花轻产品</TD>
    <TD>禁用</TD>
    </TR>
    </TABLE>
      

  9.   

    document.getElementById("table").deleteRow(2)
    这样可以了还有:
      如何得到d当前行?
      

  10.   

    <script language="JavaScript">
    <!--
    function del(oTr){
    /*for ie5+ or NS6+*/
    oTr.parentNode.removeChild(oTr)
    }
    //-->
    </script>
    <TABLE ID = oTable border=1>
    <TR onclick="del(this)" style="cursor:hand">
    <TD>黑色金属</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="del(this)" style="cursor:hand">
    <TD>橡胶制品</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="del(this)" style="cursor:hand">
    <TD>料油脂</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="del(this)" style="cursor:hand">
    <TD>花轻产品</TD>
    <TD>禁用</TD>
    </TR>
    </TABLE>see more:
    http://fason.nease.net/zhuanti/table/sample1.htm
      

  11.   

    xinyunyishui(心云意水) ( ) 
      删除是选中一条目录,然后按左边框架中的"删除目录",弹出一选择提示框,让用户确认是否真的要删除目录,按"确认"就删除一条目录,按"取消"就取消操作。如果没有选中目录,而按了左边框架中的“删除目录”,应提示用户选择要删除的目录。
      不能直接删除.
      

  12.   

    <style>
    .highlight{background-color:highlight;color:#FFFFFF}
    </style>
    <script language="JavaScript">
    <!--
    var currentRow=null
    function DeleteRow(){
    if(currentRow==null)return;
    if(confirm('delete?')){
    currentRow.parentNode.removeChild(currentRow)
    }
    }
    function del(oTr){
    if(!currentRow)currentRow=oTr
    currentRow.className=""
    oTr.className="highlight"
    currentRow=oTr
    }
    //-->
    </script>
    <TABLE ID = oTable border=1>
    <TR onclick="del(this)" style="cursor:hand">
    <TD>黑色金属</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="del(this)" style="cursor:hand">
    <TD>橡胶制品</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="del(this)" style="cursor:hand">
    <TD>料油脂</TD>
    <TD>禁用</TD>
    </TR>
    <TR onclick="del(this)" style="cursor:hand">
    <TD>花轻产品</TD>
    <TD>禁用</TD>
    </TR>
    </TABLE>
    <input type=button value="DeleteRow" onclick="DeleteRow()">
      

  13.   

    将全局变量rowIndex初始化为-1,在删除时判断rowIndex是否大于-1,若否就说明还未选中目录,需提示。
      

  14.   

    需要在左框架中删除即只要用
    <input type=button value="DeleteRow" onclick="parent.frames['right'].DeleteRow()">调用右框架的函数
      

  15.   

    选择行
      function Table1_onclick() {
        if (window.event.scrElement.tagname=="td"){
           document.all.table1.deleterow(      window.event.srcElement.parentElement.rowIndex)
        }
    }
      

  16.   

    不好意思
      tagname应为tagName
      

  17.   

    略修改
    function DeleteRow(){
    if(currentRow==null)return;
    if(confirm('delete?')){
    currentRow.parentNode.removeChild(currentRow)
    currentRow=null;//删除后再初始化
    }
    }
      

  18.   

    代码更新主框架 目录
    <table id=b>
    <tr name=0 onmousedown="check(this);">黑色金属 禁用 </tr>
    <tr name=1 onmousedown="check(this);">橡胶制品 禁用 </tr>
    <tr name=2 onmousedown="check(this);">油料油脂 禁用 </tr>
    <tr name=3 onmousedown="check(this);">花轻产品 禁用 </tr>
    </table>
    <input type=hidden name="a"><script>
    function check(id){
       document.all('a').value=this.name;
    }
    </script>
     
    左边框架
    <input type=button value="删除" onclick="test();"><script>
    function test(){
       if(self.top.frames['main']).document.all('a').value.length<1{
          alert("请选择要删除的目录");
       }else{
          var id=self.top.frames['main']).document.all('a').name;
          self.top.frames['main']).document.all('b').deleteRow(id);
      }
    }
    </script>
    这里面 <tr name=0 onmousedown="check(this);">黑色金属 禁用 </tr> 
    使用 for(i=0;i<length;i++){}循环就可以 定位行的位置了! (如:name=i)
      

  19.   

    对话框好了, fason(阿信) 的例子是一次选择一个cell,如何选择一个row?
      

  20.   

    if(confirm("是否要删除?")){
       doing.......
    }
      

  21.   

    我的例子是一次选择一个row:<TR onclick="del(this)">