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


Groups > comp.lang.javascript > #36846

Re: Getting the index of a clicked element

From James Harris <james.harris.1@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Getting the index of a clicked element
Date 2019-06-08 19:03 +0100
Organization A noiseless patient Spider
Message-ID <qdgtag$odo$1@dont-email.me> (permalink)
References <qde3ou$aqm$1@dont-email.me> <rzu6rgkcx0ct.be7zd8a6ci7q.dlg@40tude.net> <qdfv79$dvn$1@dont-email.me> <5498390.lOV4Wx5bFT@PointedEars.de>

Show all headers | View raw


On 08/06/2019 11:13, Thomas 'PointedEars' Lahn wrote:
> James Harris wrote:

...

>> Were there any browsers which supported JavaScript but not the .style
>> property?
> 
> Yes.

In that case I am right to design the system as I have: To use 
JavaScript for processing (including the 'hiding' of answers), and to 
use CSS purely for appearance.

>   
>> FWIW I got the system to work as I want it to. The complete code is
>> below. Your answer may be better but I quite like what I came up with.
> 
> Whether *you* *like* it does NOT matter.  It must *work* for the
> *customer/user*.  That is the first rule of software development,
> in particular of Web development where you have almost no idea
> where and under which circumstances your code is going to run.

As the user of it, I like it.

> 
>> I am not familiar with JavaScript so folks reading the code may find
>> things they don't like or which could be better.
> 
> Again, it is not a matter of “like”.  There are valid *reasons* why it is
> being recommended to do some things one way and not the other ways.
> 
>> Feel free to criticise it.
> 
> Thanks, but no, thanks.  I have told you how to do this easily, efficiently,
> and in a backwards-compatible way. You decided to do it hopelessly
> complicated, inefficient, and in an incompatible way instead.  Now you have
> to live with the consequences.
> 
>> [convuluted mess]

It's clear, easy to read, separates concepts, is written to cope with 
multiple browsers and browser settings, and should be fast. That's far 
from a 'mess'. I'd call it a good solution.


-- 
James Harris

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


Thread

Getting the index of a clicked element James Harris <james.harris.1@gmail.com> - 2019-06-07 17:35 +0100
  Re: Getting the index of a clicked element James Harris <james.harris.1@gmail.com> - 2019-06-07 17:59 +0100
    Re: Getting the index of a clicked element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-07 20:33 +0200
      Re: Getting the index of a clicked element dr.j.r.stockton@gmail.com - 2019-06-08 01:43 -0700
  Re: Getting the index of a clicked element "R.Wieser" <address@not.available> - 2019-06-07 19:39 +0200
    Re: Getting the index of a clicked element James Harris <james.harris.1@gmail.com> - 2019-06-08 18:52 +0100
  Re: Getting the index of a clicked element Julio Di Egidio <julio@diegidio.name> - 2019-06-07 10:45 -0700
    Re: Getting the index of a clicked element James Harris <james.harris.1@gmail.com> - 2019-06-08 18:57 +0100
      Re: Getting the index of a clicked element Julio Di Egidio <julio@diegidio.name> - 2019-06-09 05:44 -0700
  Re: Getting the index of a clicked element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-07 20:16 +0200
    Re: Getting the index of a clicked element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-07 22:48 +0200
  Re: Getting the index of a clicked element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-07 20:36 +0200
  Re: Getting the index of a clicked element JJ <jj4public@vfemail.net> - 2019-06-08 12:57 +0700
    Re: Getting the index of a clicked element James Harris <james.harris.1@gmail.com> - 2019-06-08 10:30 +0100
      Re: Getting the index of a clicked element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-08 12:13 +0200
        Re: Getting the index of a clicked element John G Harris <niam@jghnorth.org.uk.invalid> - 2019-06-08 13:35 +0100
        Re: Getting the index of a clicked element John G Harris <niam@jghnorth.org.uk.invalid> - 2019-06-08 13:45 +0100
        Re: Getting the index of a clicked element James Harris <james.harris.1@gmail.com> - 2019-06-08 19:03 +0100
          Re: Getting the index of a clicked element Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-08 21:11 +0200
            Re: Getting the index of a clicked element dr.j.r.stockton@gmail.com - 2019-06-08 14:18 -0700
  Re: Getting the index of a clicked element dr.j.r.stockton@gmail.com - 2019-06-08 02:16 -0700
    Re: Getting the index of a clicked element James Harris <james.harris.1@gmail.com> - 2019-06-08 19:14 +0100
  Re: Getting the index of a clicked element dr.j.r.stockton@gmail.com - 2019-06-10 11:29 -0700
    Re: Getting the index of a clicked element "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-06-10 23:00 +0200
      Re: Getting the index of a clicked element dr.j.r.stockton@gmail.com - 2019-06-11 03:22 -0700

csiph-web