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


Groups > comp.lang.javascript > #13347

Re: How to Pass variable name to a function

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: How to Pass variable name to a function
Date 2012-04-12 08:08 +0200
Organization albasani.net
Message-ID <jm5rh8$8s7$1@news.albasani.net> (permalink)
References <4F85B0AE.A1E9FFD8@erols.com> <4354243.e4iShcapur@PointedEars.de> <4F865E85.F8DBA81B@erols.com>

Show all headers | View raw


On 2012-04-12 06:48, Stan Weiss wrote:
> Thomas 'PointedEars' Lahn wrote:
>> 1. Your referencing is proprietary, at best error-prone, needlessly.
..
>> 2. You are referring to an identifier before you declare or define it.
..
>> 3. You are using eval().
..
>> 4. You are using eval() wrong.
..
>> 5. "Does not work" is not a problem description.
..
>> 6. You can assign to a function argument, but that does not change the
>>    value passed for that argument.
..
>> 7. The `change' event occurs on the control when the control loses focus,
..
>> 8. Avoid the window.alert() method.
..
>> 9. Is your markup Valid?

> Is this a moderated group?
> Are you the group moderator?

No and no.

> I poster enough code to get the answer I needed. While you seem to want
> to make all kinds of ASSumptions about things that were not posted.

That was actually one of Thomas's more useful replies. Nobody here would
have been surprised if he had answered your question "Can anyone see
what I am doing wrong?" with "Yes" and no further comment. At least you
didn't give him a chance to say "There is no javascript".

Manners aside, most of his points are valid. Especially: don't use
eval() unless you know exactly what you are doing; do validate the
document before you begin debugging your scripts; stanForm.VD is not a
good way to reference a form element; and don't expect an assignment to
a function parameter to be visible outside the function. These points
really are important for you to understand. The rest will come with time
and practice.

- stefan

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


Thread

How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-11 12:26 -0400
  Re: How to Pass variable name to a function Andreas Bergmaier <andber93@web.de> - 2012-04-11 19:47 +0200
    Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-11 14:21 -0400
      Re: How to Pass variable name to a function Stefan Weiss <krewecherl@gmail.com> - 2012-04-11 20:53 +0200
        Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-11 15:16 -0400
          Re: How to Pass variable name to a function Gene Wirchenko <genew@ocis.net> - 2012-04-11 15:18 -0700
  Re: How to Pass variable name to a function "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-11 21:20 +0000
  Re: How to Pass variable name to a function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-04-11 23:56 +0200
    Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-12 00:48 -0400
      Re: How to Pass variable name to a function Andrew Poulos <ap_prog@hotmail.com> - 2012-04-12 15:21 +1000
        Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-12 02:11 -0400
          Re: How to Pass variable name to a function Andrew Poulos <ap_prog@hotmail.com> - 2012-04-12 18:57 +1000
            Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-12 09:35 -0400
      Re: How to Pass variable name to a function Stefan Weiss <krewecherl@gmail.com> - 2012-04-12 08:08 +0200
        Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-12 10:13 -0400
      Re: How to Pass variable name to a function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-04-12 22:47 +0200
        Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-12 17:04 -0400
          Re: How to Pass variable name to a function Tim Streater <timstreater@greenbee.net> - 2012-04-12 22:17 +0100
          Re: How to Pass variable name to a function Scott Sauyet <scott.sauyet@gmail.com> - 2012-04-13 05:13 -0700
            Re: How to Pass variable name to a function "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-13 16:27 +0000
              Re: How to Pass variable name to a function Scott Sauyet <scott.sauyet@gmail.com> - 2012-04-16 04:11 -0700
        Re: How to Pass variable name to a function "Tom de Neef" <tdeneef@qolor.nl> - 2012-04-12 23:34 +0200
          Re: How to Pass variable name to a function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-04-13 10:03 +0200
          Re: How to Pass variable name to a function Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-04-13 12:03 +0200
            Re: How to Pass variable name to a function Andrew Poulos <ap_prog@hotmail.com> - 2012-04-13 21:35 +1000
            Re: How to Pass variable name to a function Gene Wirchenko <genew@ocis.net> - 2012-04-13 09:00 -0700
  Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-12 14:03 -0400
  Re: How to Pass variable name to a function Dr J R Stockton <reply1215@merlyn.demon.co.uk.not.invalid> - 2012-04-12 20:06 +0100
    Re: How to Pass variable name to a function Stan Weiss <srweiss@erols.com> - 2012-04-12 18:54 -0400

csiph-web