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


Groups > comp.lang.javascript > #34325

Re: simple question

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: simple question
Date 2017-11-12 20:28 +0000
Organization A noiseless patient Spider
Message-ID <87shdjutqw.fsf@bsb.me.uk> (permalink)
References <super70s-C3F170.07042612112017@reader02.eternal-september.org> <87375jwp8x.fsf@bsb.me.uk> <4024886.LvFx2qVVIh@PointedEars.de>

Show all headers | View raw


Thomas 'PointedEars' Lahn <PointedEars@web.de> writes:

> Ben Bacarisse wrote:
>
>> super70s <super70s@super70s.invalid> writes:
>>> <script language="JavaScript">
>
> Invalid, thrice.  Automatically killfiled because of the second.
>
>>> <!-- Begin
>
> Nonsense.
>
>>> var msg = new Array();
>
> The right-hand side is deprecated in favor of “[]”.
>
>>> Stamp = new Date();
>
> Undeclared variable (“var” or “const” missing), unwise identifier (is not a 
> constructor).
>
> Use JSHint.
>
>>> today = Stamp.getDate();
>
> Date.prototype.getDate() returns the number of the day of a month, not a 
> date string.
>
>>   function writeTip(msgs) {
>>       document.write(msgs[new Date().getDate()];
>>   }
>> 
>> and then call it with different arrays from two other script elements
>> (I'll show only one):
>> 
>>   <script language=JavaScript>
>>       writeTip([
>>          "dummy",
>>          "Happy first!",
>>          ...
>>          "All over for this month."
>>       ]);
>>   </script>
>> 
>> No doubt I have lots of typos since this has not been machine checked.
>
> More than that, your code, if obvious syntax errors are corrected,

Are you counting the "..."?  (I would not be surprised!)  Otherwise I
see only one.

> simply 
> would not do what you think it does.

How on Earth do you know that?  Obviously I'm guessing a bit about what
the OP wants, but it does what I want!

> Also, the HTML is still invalid.

Of course.  What possible value could there be in my adding the missing
title element to the OP's HTML?

> <http://validator.w3.org/>
>  
>
> Head shaking,

How pompous can you be?

-- 
Ben.

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


Thread

simple question super70s <super70s@super70s.invalid> - 2017-11-12 07:04 -0600
  Re: simple question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-12 14:22 +0000
    Re: simple question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-11-12 18:33 +0100
      Re: simple question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-12 20:28 +0000
        Re: simple question super70s <super70s@super70s.invalid> - 2017-11-12 15:11 -0600
          Re: simple question Andrew Poulos <ap_prog@hotmail.com> - 2017-11-13 13:26 +1100
        Re: simple question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-11-12 22:39 +0100
          Re: simple question Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-11-13 01:20 +0000
            Re: simple question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-11-13 03:49 +0100
            Re: simple question Julio Di Egidio <julio@diegidio.name> - 2017-11-13 16:45 -0800

csiph-web