Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #34325
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: simple question |
| Date | Sun, 12 Nov 2017 20:28:23 +0000 |
| Organization | A noiseless patient Spider |
| Lines | 72 |
| 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> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | reader02.eternal-september.org; posting-host="6990cf73bed5c4f34de9a73f4d41615b"; logging-data="7844"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/a9aXeDL5n9ZWj2zfNDH+sW9k3klV7wz0=" |
| Cancel-Lock | sha1:bbKVX5Z8+KmUVYKmj1UHcLDbF1Y= sha1:V9/IbYJ8ih0nC/Viqgyg/8ozbV0= |
| X-BSB-Auth | 1.e0eb54cbc09d7766070e.20171112202823GMT.87shdjutqw.fsf@bsb.me.uk |
| Xref | csiph.com comp.lang.javascript:34325 |
Show key headers only | 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
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