Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > pl.comp.lang.javascript > #3444

Re: Argument funkcji

Path csiph.com!.POSTED.194-73-239-109.cust.centrio.cz!not-for-mail
From Cezary Tomczyk <cezary.tomczyk@gmail.com>
Newsgroups pl.comp.lang.javascript
Subject Re: Argument funkcji
Date Sat, 3 Mar 2018 17:30:21 +0100
Organization csiph.com Internet News Service
Message-ID <p7eiiu$etm$1@csiph.com> (permalink)
References <5a8d1d93$0$674$65785112@news.neostrada.pl> <148vihvftubia.1e9gxiae9fy4p.dlg@40tude.net> <e4b021b8-9de9-450b-a7b8-7cbf450f6719@googlegroups.com> <1qn3p672u6yl5.1585lwp0arhbr.dlg@40tude.net> <1b368637-7199-4b74-85d2-5a359e6666e0@googlegroups.com> <15dvc5ead1h2c.cg8ko59kdlzt$.dlg@40tude.net> <246a73c9-8dc7-4ee0-946e-885933c13103@googlegroups.com> <27t8tt1m96wu.11hqw4vglcdjq.dlg@40tude.net> <d4de74d5-ae29-4205-acd7-096434f0e227@googlegroups.com> <11hsdnx36lvz3.sjxote5c1628.dlg@40tude.net> <f323afc1-4b40-449a-a09e-47e042286a28@googlegroups.com> <2762d7f6-99fd-4697-b267-dc1ce7a9fe24@googlegroups.com> <18glwbnoogv4i$.ob1q7xeh9yly$.dlg@40tude.net> <3c1ede4e-1fb8-4574-9e6a-429e512643db@googlegroups.com> <1ekeb91h9bvln$.mmvu0slmr0h3$.dlg@40tude.net> <aa018e4f-40a5-478d-a4d9-2046b62a4745@googlegroups.com> <1er8w9haivbcf$.1602yifr4w3cv.dlg@40tude.net> <8798fb76-76a4-4794-b34b-5da0c4df9e5a@googlegroups.com> <wxlhxhmn42me.1cew5dloz6okt$.dlg@40tude.net>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Sat, 3 Mar 2018 16:30:23 -0000 (UTC)
Injection-Info csiph.com; posting-host="194-73-239-109.cust.centrio.cz:109.239.73.194"; logging-data="15286"; mail-complaints-to="admin@kev009.com"
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
In-Reply-To <wxlhxhmn42me.1cew5dloz6okt$.dlg@40tude.net>
Content-Language en-US
Xref csiph.com pl.comp.lang.javascript:3444

Show key headers only | View raw


On 03/03/2018 16:34, Borys Pogoreło wrote:
> Dnia Sat, 3 Mar 2018 06:25:59 -0800 (PST), zpksoft napisał(a):
> 
>> OK, daj więc przykład. Ułatwię Ci: mamy tabelę z wierszami. User klika w
>> jakiś wiersz. Podaj mi teraz kod na jego identyfikację przez "przejście
>> po skojarzonych elementach DOM".
> 
> e.target
> 
> Ile razy można to powtarzać? To jest jednoznaczne wskazanie elementu. I
> zburzę Ci teraz wizję świata: ID w HTML wcale nie musi być unikalne.

[...]
Nie tak do końca jednoznaczne, bo:

<a href="http://www.ctomczyk.pl/" id="link"><span>Blog</span></a>

const link = document.getElementById('link');

link.addEventListener('click', eventListener);

Teraz, jak klikniesz na <span> to e.target będzie wskazywać na <span>, a 
nie na <a> ;-)

Jest jeszcze 
https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget

-- 
Cezary Tomczyk
http://www.ctomczyk.pl/

Back to pl.comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Argument funkcji "konsul41@wp.pl" <konsul41@wp.pl> - 2018-02-21 08:19 +0100
  Re: Argument funkcji "konsul41@wp.pl" <konsul41@wp.pl> - 2018-02-21 09:28 +0100
    Re: Argument funkcji Roman Tyczka <noemail@because.no> - 2018-02-21 10:52 +0100
      Re: Argument funkcji "konsul41@wp.pl" <konsul41@wp.pl> - 2018-02-21 11:00 +0100
        Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-02-26 22:10 +0100
          Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-02-27 05:10 -0800
    Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-02-21 09:22 -0800
      Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-02-27 22:18 +0100
        Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-02-28 04:53 -0800
          Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-01 00:45 +0100
            Re: Argument funkcji Adam M <amorawski@magna-power.com> - 2018-03-01 07:01 -0800
            Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-01 07:08 -0800
              Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-01 20:22 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-01 12:34 -0800
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-01 22:53 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-01 14:03 -0800
                Re: Argument funkcji Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-03-01 23:13 +0100
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-01 23:40 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-02 00:08 -0800
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-02 00:14 -0800
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-02 12:39 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-02 04:45 -0800
                Re: Argument funkcji irq <ipluta62@gmail.com> - 2018-03-02 05:22 -0800
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-02 07:10 -0800
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-03 03:25 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-03 00:45 -0800
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-03 03:19 +0100
                Re: Argument funkcji Roman Tyczka <noemail@because.no> - 2018-03-03 09:52 +0100
                Re: Argument funkcji Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-03-03 12:17 +0100
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 14:17 +0100
                Re: Argument funkcji Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-03-03 16:49 +0100
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 17:34 +0100
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-03 17:22 +0100
                Re: Argument funkcji Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-03-03 17:49 +0100
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-03 19:01 +0100
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 19:14 +0100
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-03 21:24 +0100
                Re: Argument funkcji Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-03-03 20:12 +0100
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-03 21:19 +0100
                Re: Argument funkcji Wojciech Bancer <wojciech.bancer@gmail.com> - 2018-03-03 22:32 +0100
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-03 22:36 +0100
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 22:55 +0100
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-04 10:24 +0100
                Re: Argument funkcji "PawelS pawel(at)wbcd(dot)pl" <fake@email.org> - 2018-03-09 16:51 +0100
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-02 21:10 +0100
                Re: Argument funkcji Roman Tyczka <noemail@because.no> - 2018-03-03 00:19 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-03 01:04 -0800
                Re: Argument funkcji ipluta62@gmail.com - 2018-03-03 01:14 -0800
                Re: Argument funkcji Roman Tyczka <noemail@because.no> - 2018-03-03 12:05 +0100
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 13:44 +0100
                Re: Argument funkcji Roman Tyczka <noemail@because.no> - 2018-03-03 12:04 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-03 04:40 -0800
                Re: Argument funkcji Roman Tyczka <noemail@because.no> - 2018-03-03 14:47 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-03 06:13 -0800
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-03 00:58 -0800
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 14:10 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-03 06:25 -0800
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 16:34 +0100
                Re: Argument funkcji Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2018-03-03 17:30 +0100
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 18:30 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-03 08:39 -0800
                Re: Argument funkcji Borys Pogoreło <borys@pl.edu.leszno> - 2018-03-03 19:10 +0100
                Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-03-03 10:34 -0800
  Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-02-21 05:06 -0800
  Re: Argument funkcji zpksoft <zpksoft@op.pl> - 2018-02-21 05:13 -0800

csiph-web