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


Groups > comp.lang.javascript > #31500

Re: How to write object-oriented JS function?

Newsgroups comp.lang.javascript
Date 2016-10-03 14:33 -0700
References (4 earlier) <097196c0-218d-4cce-8eb7-13e47fac5468@googlegroups.com> <6194vb178d81b2mrgg8viikpgoqusvv9il@4ax.com> <9n94vbd04gmdirnh7chp9jeqo6kp5i3n75@4ax.com> <XnsA6967A44DCB22eejj99@194.109.6.166> <8i75vbd14a0cooqv29uu5uobl0tv8vvhgs@4ax.com>
Message-ID <0e5b1be4-b2fa-467e-8c8e-22294c6aba07@googlegroups.com> (permalink)
Subject Re: How to write object-oriented JS function?
From justaguy <lichunshen84@gmail.com>

Show all headers | View raw


On Monday, October 3, 2016 at 2:07:17 PM UTC-4, John Harris wrote:
> On Mon, 03 Oct 2016 12:01:10 +0200, "Evertjan."
> <exxjxw.hannivoort@inter.nl.net> wrote:
> 
> >John Harris <niam@jghnorth.org.uk.invalid> wrote on 03 Oct 2016 in 
> >comp.lang.javascript:
> >
> >>>  jag.cnt = 1;
> >>>  if (jag.cnt == 1)
> >
> >Seems to me the if-condition is always true,
> >despite whatever orientation.
> >
> >if (!jag.cnt) let jag.cnt = 1;
> >if (jag.cnt == 1)
> 
> The == 1 is a typing error. It should have been == 20.
> 
> >...
> >jag.cnt++;
> 
>   John

This namespace thing is a bit weird tho.

My current code looks like this:
var ws = {};

	ws.addRow4Prop = function() { 
        // code goes under
	...
	}
	
	
html caller: <input type='button' onclick="ws.addRow4Prop()">

err msg: addRow4Prop is not defined

What's wrong?  Thanks.

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


Thread

How to write object-oriented JS function? justaguy <lichunshen84@gmail.com> - 2016-09-30 09:55 -0700
  Re: How to write object-oriented JS function? John Harris <niam@jghnorth.org.uk.invalid> - 2016-10-01 15:16 +0100
    Re: How to write object-oriented JS function? justaguy <lichunshen84@gmail.com> - 2016-10-01 09:23 -0700
      Re: How to write object-oriented JS function? John Harris <niam@jghnorth.org.uk.invalid> - 2016-10-02 11:27 +0100
        Re: How to write object-oriented JS function? justaguy <lichunshen84@gmail.com> - 2016-10-02 04:22 -0700
        Re: How to write object-oriented JS function? justaguy <lichunshen84@gmail.com> - 2016-10-02 11:27 -0700
          Re: How to write object-oriented JS function? John Harris <niam@jghnorth.org.uk.invalid> - 2016-10-03 10:26 +0100
            Re: How to write object-oriented JS function? John Harris <niam@jghnorth.org.uk.invalid> - 2016-10-03 10:38 +0100
              Re: How to write object-oriented JS function? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-10-03 12:01 +0200
                Re: How to write object-oriented JS function? John Harris <niam@jghnorth.org.uk.invalid> - 2016-10-03 19:07 +0100
                Re: How to write object-oriented JS function? justaguy <lichunshen84@gmail.com> - 2016-10-03 14:33 -0700
                Re: How to write object-oriented JS function? John Harris <niam@jghnorth.org.uk.invalid> - 2016-10-04 17:59 +0100
                Re: How to write object-oriented JS function? justaguy <lichunshen84@gmail.com> - 2016-10-04 20:10 -0700
                Re: How to write object-oriented JS function? justaguy <lichunshen84@gmail.com> - 2016-10-05 04:47 -0700
                Re: How to write object-oriented JS function? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-10-03 23:46 +0200
                Re: How to write object-oriented JS function? $Bill <news@todbe.com> - 2016-10-03 15:22 -0700
                Re: How to write object-oriented JS function? $Bill <news@todbe.com> - 2016-10-03 15:28 -0700
                Re: How to write object-oriented JS function? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-10-04 09:16 +0200
                Re: How to write object-oriented JS function? $Bill <news@todbe.com> - 2016-10-04 00:46 -0700
                Re: How to write object-oriented JS function? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-10-04 14:56 +0200
                Re: How to write object-oriented JS function? John Harris <niam@jghnorth.org.uk.invalid> - 2016-10-04 16:49 +0100
                Re: How to write object-oriented JS function? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-10-04 19:55 +0200

csiph-web