Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18502 > unrolled thread

Node removal problem

Started byjustaguy <lichunshen84@gmail.com>
First post2013-02-16 10:09 -0800
Last post2013-02-18 22:01 +0100
Articles 5 on this page of 25 — 5 participants

Back to article view | Back to comp.lang.javascript


Contents

  Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 10:09 -0800
    Re: Node removal problem Martin Honnen <mahotrash@yahoo.de> - 2013-02-16 19:29 +0100
      Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 10:37 -0800
        Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 10:44 -0800
        Re: Node removal problem Martin Honnen <mahotrash@yahoo.de> - 2013-02-16 19:46 +0100
          Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 11:10 -0800
            Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 13:25 -0800
              Re: Node removal problem SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-18 14:56 +0100
                Re: Node removal problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-18 22:05 +0100
          Re: Node removal problem Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-16 23:05 +0100
            Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 14:44 -0800
              Re: Node removal problem Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-16 23:51 +0100
    Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 15:19 -0800
    Re: Node removal problem SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-17 02:46 +0100
    Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 17:59 -0800
      Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 18:44 -0800
        Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 19:08 -0800
          Re: Node removal problem justaguy <lichunshen84@gmail.com> - 2013-02-16 19:54 -0800
          Re: Node removal problem SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-18 14:41 +0100
      Re: Node removal problem SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-18 13:07 +0100
        Re: Node removal problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-18 14:29 +0100
          Re: Node removal problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-18 14:36 +0100
            Re: Node removal problem SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-18 15:13 +0100
          Re: Node removal problem SAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid> - 2013-02-18 15:05 +0100
            Re: Node removal problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-18 22:01 +0100

Page 2 of 2 — ← Prev page 1 [2]


#18538

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2013-02-18 14:29 +0100
Message-ID<XnsA16B9359EF661eejj99@194.109.133.133>
In reply to#18537
SAM wrote on 18 feb 2013 in comp.lang.javascript:

>          <td style="cursor:pointer"
>          onclick="
>           var a = this.parentNode;
>           while(a.tagName.tolowerCase()!='tr') a=a.parentNode;
>           a.parentNode.removeChild(a);
>           ">

toLowerCase(), not tolowerCase()

shorter is:

<td style="cursor:pointer" onclick="
   var a = this;
   while(a.tagName.toLowerCase()!='tr') a=a.parentNode;
   a.parentNode.removeChild(a);
">

or 

<td style="cursor:pointer" onclick="
   var a = this;
   while( !/tr/i.test(a.tagName) ) a=a.parentNode;
   a.parentNode.removeChild(a);
">

but what is wrong with:

<td style="cursor:pointer" onclick="
   var a = this.parentNode;
   a.parentNode.removeChild(a);
">

Surely the parentNode of a <td> always is a <tr>?


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#18539

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2013-02-18 14:36 +0100
Message-ID<XnsA16B94AC6714eejj99@194.109.133.133>
In reply to#18538
Evertjan. wrote on 18 feb 2013 in comp.lang.javascript:

> but what is wrong with:
> 
> <td style="cursor:pointer" onclick="
>    var a = this.parentNode;
>    a.parentNode.removeChild(a);
> ">
> 
> Surely the parentNode of a <td> always is a <tr>?

or

<td style="cursor:pointer" 
onclick="
   var a;
   (a = this.parentNode).parentNode.removeChild(a);
"> 



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#18543

FromSAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid>
Date2013-02-18 15:13 +0100
Message-ID<51223704$0$8994$ba4acef3@reader.news.orange.fr>
In reply to#18539
Le 18/02/13 14:36, Evertjan. a écrit :
> Evertjan. wrote on 18 feb 2013 in comp.lang.javascript:
>
>> but what is wrong with:
>>
>> <td style="cursor:pointer" onclick="
>>     var a = this.parentNode;
>>     a.parentNode.removeChild(a);
>> ">
>>
>> Surely the parentNode of a <td> always is a <tr>?
>
> or
>
> <td style="cursor:pointer"
> onclick="
>     var a;
>     (a = this.parentNode).parentNode.removeChild(a);
> ">

from one of justaguy posts I understood that he wanted to remove the 
table containing the row of the clicked cell

the problem I saw in justaguy's code is that the table to remove isn't 
in the cell of a row of the parent table

By there I can't expect that the TD will be in a TR nor the TR in a 
TABLE (so backwards in code)

-- 
Stéphane Moriaux avec/with iMac-intel

[toc] | [prev] | [next] | [standalone]


#18542

FromSAM <stephanemoriaux.NoAdmin@wanadoo.fr.invalid>
Date2013-02-18 15:05 +0100
Message-ID<5122350d$0$1188$ba4acef3@reader.news.orange.fr>
In reply to#18538
Le 18/02/13 14:29, Evertjan. a écrit :
> SAM wrote on 18 feb 2013 in comp.lang.javascript:
>
>>           <td style="cursor:pointer"
>>           onclick="
>>            var a = this.parentNode;
>>            while(a.tagName.tolowerCase()!='tr') a=a.parentNode;
>>            a.parentNode.removeChild(a);
>>            ">
>
> toLowerCase(), not tolowerCase()

OOOooops !!!

> Surely the parentNode of a <td> always is a <tr>?


Not at all sure with the html code of "justaguy" !!!

If I can make mistake I'm not alone :
that guy puts a table directly in a table
(not in the cell of a row of a table)

-- 
Stéphane Moriaux avec/with iMac-intel

[toc] | [prev] | [next] | [standalone]


#18547

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2013-02-18 22:01 +0100
Message-ID<XnsA16BE0155C38Aeejj99@194.109.133.133>
In reply to#18542
SAM wrote on 18 feb 2013 in comp.lang.javascript:

> Le 18/02/13 14:29, Evertjan. a Drit :
>> SAM wrote on 18 feb 2013 in comp.lang.javascript:
>>
>>>           <td style="cursor:pointer"
>>>           onclick="
>>>            var a = this.parentNode;
>>>            while(a.tagName.tolowerCase()!='tr') a=a.parentNode;
>>>            a.parentNode.removeChild(a);
>>>            ">
>>
>> toLowerCase(), not tolowerCase()
> 
> OOOooops !!!
> 
>> Surely the parentNode of a <td> always is a <tr>?
> 
> 
> Not at all sure with the html code of "justaguy" !!!

Then the code is in error.

A <td> has only and always one parent and that is an <tr>.

Ask just another guy.

> If I can make mistake I'm not alone :
> that guy puts a table directly in a table
> (not in the cell of a row of a table)

You cannot do that, try it. ;-)

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.javascript


csiph-web