Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #34323
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: simple question |
| Date | 2017-11-12 18:33 +0100 |
| Organization | PointedEars Software (PES) |
| Message-ID | <4024886.LvFx2qVVIh@PointedEars.de> (permalink) |
| References | <super70s-C3F170.07042612112017@reader02.eternal-september.org> <87375jwp8x.fsf@bsb.me.uk> |
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, simply
would not do what you think it does.
Also, the HTML is still invalid.
<http://validator.w3.org/>
Head shaking,
--
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.
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