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


Groups > comp.lang.javascript > #28533

Re: Recursive function to find a node in the DOM

Path csiph.com!news.swapon.de!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.datemas.de!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Recursive function to find a node in the DOM
Date Sun, 16 Aug 2015 08:48:58 +0200
Organization PointedEars Software (PES)
Lines 44
Message-ID <2800685.3l0yYTo2pD@PointedEars.de> (permalink)
References <mo53os$am9$1@dont-email.me> <5530725.v0RXNFEj4j@PointedEars.de> <mq3qpn$nn$1@solani.org> <1885256.KGaLaWtVka@PointedEars.de> <mqdu4i$sbr$1@solani.org> <4738754.gQ6MLv009L@PointedEars.de> <mqj218$fvq$1@solani.org>
Reply-To Thomas 'PointedEars' Lahn <usenet@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1439707946 10007 eJwFwQEBwCAMAzBLrNDukwM79S+BhFOhziVq0XScBrJwPQezdxTlEqrOHmmd7boE1BjW/z0TNhDg (16 Aug 2015 06:52:26 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Sun, 16 Aug 2015 06:52:26 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwNy8EBwCAIA8CViiRRxgEp+4/Q3v/oMt0NUeBwuuoMK82Ze8IsnvQeREyDF/JnI6lmKeDod2HuWup/7hMfXtoVoQ==
Cancel-Lock sha1:16QQA3J7AS18n0ncrLgwxdmOERg=
X-NNTP-Posting-Host eJwFwYEBADAEA7CbjBbn2PD/CUugFD43gobFWt8YPgZjvaymyiRzFHRKaPUBVdZvR2SfDyCGEPA=
Mail-Copies-To usenet@PointedEars.de
Xref csiph.com comp.lang.javascript:28533

Show key headers only | View raw


Christoph M. Becker wrote:

> On 12.08.2015 at 01:18, Thomas 'PointedEars' Lahn wrote:
>> Christoph M. Becker wrote:
>>> On 08.08.2015 at 09:33, Thomas 'PointedEars' Lahn wrote:
>>>> […] you can do an iterative "user-land" walk of the document tree as
>>>> well; for example: […]
>>>>
>>> How can this be done with an iterative algorithm?
>> You are the reader, you figure it out :-p
> 
> Well, you have claimed "you can do an iterative "user-land" walk of the
> document tree", so you may care to explain how. :)

I thought my illustration above in combination with what I said about the 
property values under certaining conditions was, well, illustrative.  
Perhaps you want to use a fixed-width font.  Simply handing out the 
algorithm would defeat the purpose of the exercise.

> I claim that […].  I am not able to prove that, however.

We can safely ignore it then.
 
> FWIW, I might do something like the following:
> 
>     function eachChildOf(node, func) {
               ^^^^^^^^^^^
>         node = node.firstChild;
>         while (node) {
>             func(node);
>             eachChildOf(node, func);
              ^^^^^^^^^^^^^^^^^^^^^^^^
>             node = node.nextSibling;
>         }
>     }

But that is recursion, and, as I indicated, you can do this without 
recursion.  Try again.
 
-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 09:59 +0200
  Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-15 11:59 +0200
    Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-15 12:03 +0200
    Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 13:36 +0200
      Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-19 12:27 +0200
        Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-19 12:34 +0200
        Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-21 12:08 +0200
          Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-25 14:11 +0200
            Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-25 21:22 +0200
              Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-27 16:12 +0200
    Re: Recursive function to find a node in the DOM "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-08-08 04:50 +0200
      Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-08-08 09:33 +0200
        Re: Recursive function to find a node in the DOM "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-08-12 00:48 +0200
          Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-08-12 01:18 +0200
            Re: Recursive function to find a node in the DOM "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-08-13 23:26 +0200
              Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-08-16 08:48 +0200
                Re: Recursive function to find a node in the DOM "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-08-20 02:11 +0200
  Re: Recursive function to find a node in the DOM Scott Sauyet <scott.sauyet@gmail.com> - 2015-07-18 15:59 -0700
    Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-21 12:30 +0200
      Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-21 13:53 +0200
        Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-21 14:51 +0200
          Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-21 16:05 +0200
            Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-21 20:35 +0200
            Re: Recursive function to find a node in the DOM Scott Sauyet <scott.sauyet@gmail.com> - 2015-07-30 22:10 -0700
              Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-08-06 10:07 +0200
                Re: Recursive function to find a node in the DOM Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-08-06 20:15 +0200
                Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-08-08 01:21 +0200
        Re: Recursive function to find a node in the DOM Scott Sauyet <scott.sauyet@gmail.com> - 2015-07-30 22:09 -0700
  Re: Recursive function to find a node in the DOM Denis McMahon <denismfmcmahon@gmail.com> - 2015-07-29 03:04 +0000
    Re: Recursive function to find a node in the DOM "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-08-06 10:20 +0200

csiph-web