Time Greeting for your Website

 


Target It! Marketing bring you a variety of Freeware, Free Downloads, Free Software, Free html codes, Free JavaScripts, Free Scripts and more...

 

Just copy and paste

Time Greeting 
Good Morning! 

Don't just welcome your visitors! Here's a JavaScript that can write good morning, good evening, or good afternoon based on the time the page was loaded, according to the user's system clock. 

ONE STEP TO INSTALL TIME GREETING: 
1. Copy the coding into the BODY of your HTML document. This should appear anywhere between <BODY> ... </BODY>.
 
(remember to copy and paste this code to a notepad first - then copy to your html)



<SCRIPT LANGUAGE="JavaScript"> 
<!-- Begin 
datetoday = new Date(); 
timenow=datetoday.getTime(); 
datetoday.setTime(timenow); 
thehour = datetoday.getHours(); 
if (thehour > 18) display = "Evening"; 
else if (thehour >12) display = "Afternoon"; 
else display = "Morning"; 
var greeting = ("Good " + display + "!"); 
document.write(greeting); 
// End --> 
</script>