Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.computer > #10648
| From | Paul <nospam@needed.invalid> |
|---|---|
| Newsgroups | alt.computer |
| Subject | Re: javascript help, please |
| Date | 2018-01-02 04:26 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <p2fj8s$1k7$1@dont-email.me> (permalink) |
| References | <kRy2C.27980$b_.4386@fx23.iad> |
Robert Baer wrote:
> One question inside the program; (new line)?
>
> The other is: how in the heck does one get an "if" to work (that
> second document.write() does not execute when that if exists).
>
> Thanks.
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
https://stackoverflow.com/questions/5758161/how-do-i-create-a-new-line-in-javascript
Use the \n for a newline character.
document.write("\n");
However, if this is rendering to HTML, you will want to use the HTML tag for a newline:
document.write("<br>");
Don't ask me what that means though - what is this "rendering" thing ?
*******
A quick Google on "if then else" shows two examples.
if (hour < 18) {
greeting = "Good day";
}
if (hour < 18) {
greeting = "Good day";
} else {
greeting = "Good evening";
}
HTH,
Paul
Back to alt.computer | Previous | Next — Next in thread | Find similar | Unroll thread
Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-02 04:26 -0500
Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-02 13:56 -0800
Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-02 18:18 -0500
Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-07 16:24 -0800
Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-09 22:23 -0800
Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-10 03:44 -0500
Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-10 22:44 -0500
Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-12 02:49 -0500
Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-12 21:10 -0800
Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-12 03:00 -0500
Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-12 21:16 -0800
Re: javascript help, please Paul <nospam@needed.invalid> - 2018-01-12 04:29 -0500
Re: javascript help, please Robert Baer <robertbaer@localnet.com> - 2018-01-12 21:39 -0800
csiph-web