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


Groups > comp.lang.javascript > #28421

Re: Retrieve a select from a table cell

Path csiph.com!usenet.pasdenom.info!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: Retrieve a select from a table cell
Date Tue, 14 Jul 2015 22:07:08 +0200
Organization PointedEars Software (PES)
Lines 23
Message-ID <3951517.CJbgAzKFgc@PointedEars.de> (permalink)
References <mo2utl$9s5$1@dont-email.me> <mo3oq2$qo5$1@speranza.aioe.org> <mo3pud$u2u$1@speranza.aioe.org>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1436904615 16595 eJwFwYEBgDAIA7CXptAi5wwK/59gAuPDDifoWOzYCSY2N2PubleUXOI7GDlwVDafjVPWvD8zSRIJ (14 Jul 2015 20:10:15 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Tue, 14 Jul 2015 20:10:15 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwFwQkBwDAIA0BLlBA65PAU/xJ2R/jxvuZ043ILiZStemBCpKdHvulshARTn6/C2B0jHgk9FXpDnKYB/HL7FUc=
Cancel-Lock sha1:KS8XN2QEcthkP5nH0fvNxl8+mEA=
X-NNTP-Posting-Host eJwNwoERwCAIBLCVEPgHxqmg+49gL4FxscMJOu5PscqYBqmsbUHd0X1nRs2/PNM8CEMtFZd+/9QQTQ==
Xref csiph.com comp.lang.javascript:28421

Show key headers only | View raw


Joao Rodrigues wrote:

>   function cellClick(e) {
>     var fc = e.target;
>     if (/input|select/i.test(fc.tagName)) {
>       window.alert(fc.type + " - " + fc.nodeName
>                    + " - " + fc.value + " - "
>                    + fc.nodeType);
>     }
>   }

Not only as insufficient as your first approach (see my other follow-up), 
but even more inefficient and error-prone.  If you are using a regular 
expression, you need to anchor it to prevent false positives, at least 
/^(input|select)$/i.  But you can do without such an expensive RegExp here.  
Finally, the “input” appears to be coming from your imagination only; read 
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

Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-14 14:24 +0200
  Re: Retrieve a select from a table cell "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-07-14 14:45 +0200
    Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 16:54 +0200
      Re: Retrieve a select from a table cell "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-07-14 23:20 +0200
    Re: Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 09:11 +0200
  Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 21:36 +0200
    Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 21:41 +0200
    Re: Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 09:10 +0200
      Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-15 09:46 +0200
        Re: Retrieve a select from a table cell "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-07-15 10:03 +0200
          Re: Retrieve a select from a table cell "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2015-07-15 06:33 -0700
        Re: Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 10:17 +0200
          Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-15 11:47 +0200
            Re: Retrieve a select from a table cell "danca (Daniele Campagna)" <cyberdanny@tiscalinet.it> - 2015-07-15 13:11 +0200
              Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-18 18:04 +0200
  Re: Retrieve a select from a table cell Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-07-14 16:44 -0300
    Re: Retrieve a select from a table cell Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-07-14 17:03 -0300
      Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 22:07 +0200
        Re: Retrieve a select from a table cell Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-07-14 17:28 -0300
          Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-15 00:23 +0200
    Re: Retrieve a select from a table cell Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-14 22:02 +0200

csiph-web