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


Groups > comp.lang.javascript > #31844

Re: How to deal with "messy" quotes?

From <cyber@example.com>
Subject Re: How to deal with "messy" quotes?
Newsgroups comp.lang.javascript
References (5 earlier) <71de1dbd-1779-4131-8c68-4c9d6e01d774@googlegroups.com> <FfR3A.215307$223.44894@fx20.am4> <1903833.irdbgypaU6@PointedEars.de> <v9X3A.374775$kM7.66678@fx44.am4> <6635730.EvYhyI6sBW@PointedEars.de>
Message-ID <ibY3A.365145$4Z7.313359@fx38.am4> (permalink)
Organization free.xsusenet.com
Date 2016-12-13 19:43 +0000

Show all headers | View raw


Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote:
> cyber@example.com wrote:
> 
>> Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote:
>>> cyber@example.com wrote:
>>>> justaguy <lichunshen84@gmail.com> wrote:
>>>>> On Monday, December 12, 2016 at 5:10:17 PM UTC-5, justaguy wrote:
>>>>>> On Monday, December 12, 2016 at 1:15:22 PM UTC-5, cy...@example.com
>>>>>> wrote:
>>>>>> > justaguy <> wrote:
>>>>>> > > On Monday, December 12, 2016 at 12:53:40 PM UTC-5,
>>>>>> > > cy...@example.com wrote:
>>>>>> > >> var newFN = function(f,n) {
>>>                               ^^^
>>>>>> > >>   console.log(f,n);
>>>>>> > >>   }
>>>> […]
>>>> This should work:
>>>> 
>>>> s2.innerHTML = "&nbsp;"
>>>>   + fn +
>>>> " <input type='button' id='NewEl"+num+"' value='x' onclick =
>>>   ^                               ^
>>>> 'newFN(\""+fn+"\" + "+num+");'>";
>>>                 ^^^^^^^^^^^^^^
>>> It does not.  (The value of) “num” has to be (the value of) the *second*
>>> argument to newFN().
>> 
>> It does work.
> 
> For suitable values of “work”.

It produces the intended result without error in all major browsers.
That seems like a reasonable definition to me.

>> In javascript
> 
> There is no “javascript”.

Guess this room should be renamed to comp.lang.notjavascript then.

>> parameters default to undefined
> 
> In implementations of ECMAScript, the value of formal parameters for which 
> no argument was passed usually defaults to the “undefined” value.

The author his code is likely meant for browsers.
This means that talking about implementations of ECMAScript in general
might not be as relevant to him as talking about Javascript as implemented
in the major browsers is.

>> and the second parameter will be set to undefined.
> 
> This is obviously not what the OP wants, so it is bad advice.
> 
He edited my code to pass 1 argument instead of 2 which made me think that
he changed his mind and now only wanted to pass 1 argument instead of 2.
And since we do not know what he wants to do with this (newFN seems to
be a mere placeholder for testing purposes) it really is not that obvious what
he wants.

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


Thread

How to deal with "messy" quotes? justaguy <lichunshen84@gmail.com> - 2016-12-11 16:23 -0800
  Re: How to deal with "messy" quotes? JJ <jj4public@vfemail.net> - 2016-12-12 12:42 +0700
    Re: How to deal with "messy" quotes? justaguy <lichunshen84@gmail.com> - 2016-12-12 09:56 -0800
      Re: How to deal with "messy" quotes? JJ <jj4public@vfemail.net> - 2016-12-13 18:18 +0700
        Re: How to deal with "messy" quotes? JJ <jj4public@vfemail.net> - 2016-12-13 18:22 +0700
          Re: How to deal with "messy" quotes? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-13 13:10 +0100
    Re: How to deal with "messy" quotes? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-12 20:43 +0100
  Re: How to deal with "messy" quotes? <cyber@example.com> - 2016-12-12 17:53 +0000
    Re: How to deal with "messy" quotes? justaguy <lichunshen84@gmail.com> - 2016-12-12 10:05 -0800
      Re: How to deal with "messy" quotes? <cyber@example.com> - 2016-12-12 18:15 +0000
        Re: How to deal with "messy" quotes? justaguy <lichunshen84@gmail.com> - 2016-12-12 14:10 -0800
          Re: How to deal with "messy" quotes? justaguy <lichunshen84@gmail.com> - 2016-12-12 16:56 -0800
            Re: How to deal with "messy" quotes? <cyber@example.com> - 2016-12-13 11:49 +0000
              Re: How to deal with "messy" quotes? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-13 13:17 +0100
                Re: How to deal with "messy" quotes? <cyber@example.com> - 2016-12-13 18:32 +0000
                Re: How to deal with "messy" quotes? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-13 19:47 +0100
                Re: How to deal with "messy" quotes? <cyber@example.com> - 2016-12-13 19:43 +0000
                Re: How to deal with "messy" quotes? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-14 12:24 +0100
              Re: How to deal with "messy" quotes? justaguy <lichunshen84@gmail.com> - 2016-12-13 17:07 -0800
    Re: How to deal with "messy" quotes? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-12 21:19 +0100
      Re: How to deal with "messy" quotes? justaguy <lichunshen84@gmail.com> - 2016-12-12 12:51 -0800
  Re: How to deal with "messy" quotes? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-12 20:50 +0100

csiph-web