Note that there are some explanatory texts on larger screens.

plurals
  1. POTesting the RemoveNode DOM function
    primarykey
    data
    text
    <p>I have the following test html:</p> <pre><code>&lt;table width="80%" border="0" cellspacing="0" cellpadding="1" &gt; &lt;tr&gt; &lt;td class="tableBorder"&gt; &lt;table id="scriptsT" name="scriptsT" width="100%" border="0" cellspacing="1" cellpadding="0"&gt; &lt;tr&gt; &lt;td colspan="4" class="tableTitle"&gt;&amp;#8250; College Foo - ScriptList:&lt;/td&gt; &lt;/tr&gt; &lt;tr class="rowHeaders"&gt; &lt;td width="4%"&gt;ScriptName&lt;/td&gt; &lt;td width="2%"&gt;Main Script (Radio)&lt;/td&gt; &lt;td width="2%"&gt;(Ext)&lt;/td&gt; &lt;td width="2%"&gt;Del Script&lt;/td&gt; &lt;/tr&gt; &lt;tr id="foo[1]" name="foo[1]" class="rowHeaders"&gt; &lt;td id="sTD" name="sTD" width="4%"&gt;Script1&lt;/td&gt; &lt;td width="2%"&gt; &lt;input type="radio" name="main" id="main" value=""&gt; &lt;/td&gt; &lt;td id="tTD" name="tTD" width="2%"&gt;Php&lt;/td&gt; &lt;td width="2%"&gt;&lt;input type="Button" class="textbox" name="SelScript" id="" value="DelScript" onClick="javascript: DelScript(1); return false;"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>=======================================================</p> <p>I'm trying to remove the node, using the "DelScript function, that tries to use an ID to select the given TR, based on each TR having a unique ID, in this case foo[1], etc..</p> <p>In my test DelScript, I 1st get the table, and then try to get the childnode (the "TR") to delete.</p> <pre><code>//--handle/simulate the deletion of the tr in the scriptTBL for the id function DelScript(id) { var scriptTBL=document.getElementById("scriptsT"); var a="foo["+id+"]" var test=document.getElementById("foo[1]"); //scriptTBL.parentNode.removeChild(test); scriptTBL.removeChild(test); alert("foo"); var a; } </code></pre> <p>However, I'm screwing something up, as I'm not able to delete the node. </p> <p>I'm running FF4, and firefox seems to be saying the node can't be found (???).</p> <p>I've also tried using the parentNode a well but get the same results.</p> <p>Thank you for any pointers.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload