inherit
3647
0
Apr 19, 2006 15:20:48 GMT -8
WelshBoy2508
148
May 2002
welshboy2508
|
Post by WelshBoy2508 on Sept 5, 2005 16:16:13 GMT -8
Sometime ago I had a code (which I no longer have) that looked at the server time and then displayed a welcome message based on that time, so between midnight and 11.59am it said "Good morning", 12.00pm to 5.59pm it says "Good afternoon" and 6 - midnight it said "Good evening" Where can I find this code please? Not having much luck through the search engines..
|
|
inherit
26561
0
Mar 8, 2009 17:02:03 GMT -8
Mike Lohmer
Classic
2,880
June 2004
mikelohmer
|
Post by Mike Lohmer on Sept 5, 2005 16:16:43 GMT -8
You should probably request it.
|
|
inherit
3647
0
Apr 19, 2006 15:20:48 GMT -8
WelshBoy2508
148
May 2002
welshboy2508
|
Post by WelshBoy2508 on Sept 5, 2005 16:18:38 GMT -8
No, as I said, i've had the code before from a website. Not sure where though, hence why I asked.
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Sept 5, 2005 16:30:48 GMT -8
Is it something like This that you're after?
|
|
inherit
3647
0
Apr 19, 2006 15:20:48 GMT -8
WelshBoy2508
148
May 2002
welshboy2508
|
Post by WelshBoy2508 on Sept 5, 2005 16:38:51 GMT -8
Something like that though my last script was ASP, JS is fine though.
I'm not too good with JS though, how do I get a simpler code?
IE: 00.00 - 11.59am - Good morning 12.00pm - 5.59pm - Good afternoon 6.00pm - 23.59am - Good evening
Thanks for your help so far.
EDIT: I guess I could just use the same message for the hours I want...
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
Post by Ross on Sept 5, 2005 17:57:14 GMT -8
Well here's a greatly simplified version <div id='message' align='center'></div>
<script type="text/javascript"> <!-- hr = new Date().getHours() if(hr <= 11){document.getElementById('message').innerHTML="Good Morning";} else if (hr <= 17) {document.getElementById('message').innerHTML="Good afternoon";} else{document.getElementById('message').innerHTML="Good evening";} //---> </script>
|
|