Tips
All Tips ]

Different pages for day and night

Life during the day is different to life at night. If you want to reflect this on your site, then this script is for you. It displays different pages, depending on whether the user connects to your site during the day or at night.

To obtain this effect, place the following lines of code between the <BODY> and </BODY> tags of your page.

<SCRIPT LANGUAGE = "JavaScript">
<!--
now = new Date();
hour = now.getHours();

if (hour > 4 && hour < 19) {  

location.href="http://www.yourdomain.com/dayfile.html"}

else {
location.href="http://www.yourdomain.com/nightfile.html"}

// -->
</SCRIPT>

Discover all Webmaster tips.