This script will output a greeting based on the time of day on the client side, an example of the output is
Good Morning!
A useful, widely requested script.
<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>
No mentions on Twitter yet. (Be the first to Tweet this post)
Host your site with EUKHost and Save 10%, use coupon 10%NEW, Dedicated, VPS, Shared, Linux, Windows, Reseller - save money on web hosting with our web hosting coupons.
Similar articles on NetEvolution.co.uk