This javascript will display a different greeting depending on what time of day it is for your visitor. There is a default welcome message provided for those using a browser that doesn't support javascript (or who surf with javascript turned off). |
See how it's used Grab the source See more javascripts |
<SCRIPT> <!-- start hiding // Written by: // C. Schaar aka sleepy // http://www.geocities.com/Heartland/Hollow/1000/ var now = new Date(); var hours = now.getHours(); if (hours < 5) { document.write("Hey there night-owl!") } if (hours > 4 || < 12) { document.write("Good morning!") } else if (hours > 11 || hours < 18) { document.write("Good afternoon!") } else { document.write("Good evening!") } // stop hiding --> </SCRIPT> <!-- provide alternative for javascript disabled browsers --> <NOSCRIPT> Welcome! </NOSCRIPT> |