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


Groups > comp.lang.javascript > #37142

Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it.

Path csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it.
Date Thu, 15 Aug 2019 00:42:25 +0100
Organization A noiseless patient Spider
Lines 35
Message-ID <874l2jmhzy.fsf@bsb.me.uk> (permalink)
References <7289e763-fc8c-4686-8f68-12094ee06440@googlegroups.com> <7fc94d37-a44c-43a0-bb81-b9116f9d20fa@googlegroups.com> <0c7e3cae-3c01-4ca8-a2e9-db004a2de1b8@googlegroups.com> <a0e41c4b-b8bb-47bc-ad7b-af4db6447a87@googlegroups.com> <b57ec9b5-1fd0-4aab-9cf6-5304433677c2@googlegroups.com> <05dbfbb6-648f-4cbf-89e6-7fb1d1e3b44e@googlegroups.com> <25a5b812-2599-492a-856c-b052f9024d4d@googlegroups.com> <26c701d7-cb23-44f2-9ca2-b4c30b888030@googlegroups.com> <XnsAAA879E54D98Ceejj99@194.109.6.166> <qiopp9$1lea$1@gioia.aioe.org> <grarq0FaqaoU3@mid.individual.net> <qipma1$1j4v$2@gioia.aioe.org> <grcphoFngkiU1@mid.individual.net> <qisja6$drj$1@gioia.aioe.org> <grfqv2Fd6scU1@mid.individual.net> <qiuv5g$utu$1@gioia.aioe.org> <grhp51FpuleU2@mid.individual.net> <qj0gej$1gv1$1@gioia.aioe.org> <87ef1nnce9.fsf@bsb.me.uk> <qj117j$1ten$1@gioia.aioe.org>
Mime-Version 1.0
Content-Type text/plain
Injection-Info reader02.eternal-september.org; posting-host="f21d696dce3cdbf81e49f4ce0ccbca52"; logging-data="7933"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193PDjmKeqEKBo8e3XTgrZujlbfj4MMzUI="
Cancel-Lock sha1:LXXc0DdBiapYMuGdY04psL8x77E= sha1:ZgJqavw95o8uWDm5ScUWkHvMSbY=
X-BSB-Auth 1.a503bc5e3d901fddc05e.20190815004225BST.874l2jmhzy.fsf@bsb.me.uk
Xref csiph.com comp.lang.javascript:37142

Show key headers only | View raw


"R.Wieser" <address@not.available> writes:

> Ben,
>
>> Jumping in, so maybe I've missed some context, but
>> this is a keyword which makes it different in other ways.
>> For example, you can't use it its an identifier, but it can
>> be a property name.
>
> Thanks for that info.  It doesn't change anything for the examples that 
> where posted, but its certainly is a difference to recon with.

I went back to find an example and I see that this has been gone over
already.  The fact that 'this' is a keyword does make a difference to
that example, which was Evertjan saying:

| you should NEVER use "this" as a variable
| in the receiving function:
|  
| function korgvol(this) {
|    if (this.id=="korgvol2") {CCtype=1}}
| };

You asked why, and the reason is that the above has a syntax error in it,
just as if it had been written

| function korgvol(while) {
|    if (while.id=="korgvol2") {CCtype=1}}
| }

That does not apply to using identifiers like "document" or "window", no
matter how ill-advised that might be in some situations.

-- 
Ben.

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


Thread

Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-08 16:50 -0700
  Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-08 16:55 -0700
  Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-08-09 00:16 -0700
    Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Julio Di Egidio <julio@diegidio.name> - 2019-08-09 00:46 -0700
      Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-10 02:03 -0700
        Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-10 11:12 +0200
      Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-10 02:08 -0700
        Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Julio Di Egidio <julio@diegidio.name> - 2019-08-10 03:14 -0700
          Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-10 16:32 -0700
            Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-10 16:36 -0700
            Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. dr.j.r.stockton@gmail.com - 2019-08-11 01:39 -0700
              Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-11 02:38 -0700
                NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-11 11:58 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-11 12:13 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-11 12:31 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-11 20:15 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-11 17:50 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-11 20:20 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. dr.j.r.stockton@gmail.com - 2019-08-11 13:54 -0700
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-12 08:48 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. dr.j.r.stockton@gmail.com - 2019-08-13 14:43 -0700
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-14 08:43 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-12 12:13 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-12 11:24 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-12 12:14 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-12 12:42 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-12 22:48 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-13 15:06 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-13 15:07 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-13 20:22 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-14 08:47 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-14 10:23 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-08-14 13:45 +0100
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-14 15:10 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-08-15 00:42 +0100
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Julio Di Egidio <julio@diegidio.name> - 2019-08-14 20:51 -0700
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-08-15 14:12 +0100
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-15 09:09 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-08-15 14:11 +0100
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "R.Wieser" <address@not.available> - 2019-08-15 17:34 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Julio Di Egidio <julio@diegidio.name> - 2019-08-19 10:43 -0700
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-14 17:25 +0200
                Re: NEVER use "this" as a variable Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-14 13:10 -0700
            Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Julio Di Egidio <julio@diegidio.name> - 2019-08-12 09:30 -0700
              Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-12 11:55 -0700
                Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-12 11:58 -0700
          Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-08-10 18:48 -0700
            Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-08-11 16:25 +0100
              Extracting numbers from strings, using templates (was: Is the input type ID passed as a parameter onChange? If not how can i achieve it.) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-08-12 22:10 +0200
                Re: Extracting numbers from strings, using templates (was: Is the input type ID passed as a parameter onChange? If not how can i achieve it.) Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-08-13 00:23 +0000
  Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-09 11:59 +0200
    Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-09 13:54 +0200
      Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-09 14:53 +0200
        Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-09 15:35 +0200
          Re: Is the input type ID passed as a parameter onChange? If not how can i achieve it. Arno Welzel <usenet@arnowelzel.de> - 2019-08-09 17:16 +0200

csiph-web