Take a break and keep your site fresh at the same time. Find out how to dynamically write parts of your Web pages.
By Holly Cunningham
Paste this code into the
<HEAD> of your Web page:
Now you have two variables,
theHour, that hold the reader's day of the week (as a number from 0 to 6, starting from Sunday) and hour of the day (from 0 to 23). You will use these variables in scripts (placed in the
<BODY> of your page) that will dynamically write parts of your page. You can easily preview your own time- or date-based pages by temporarily resetting your computer's clock.
If it's ecru, it must be Tuesday
For example, for a custom color scheme based on the day of the week, replace your opening
<BODY> tag with a script such as this:
Or perhaps you'd like a daily image with an optional message:
Touch me in the morning, when I am blanchedalmond
Maybe your audience is unusually perceptive, or maybe you just want to up the tempo. Use a similar script based on
theHour to make the appearance change as many times a day as you like--every hour if that's what it takes. Here's an example where we assume that people crave newness from you about four times a day; you could change it to smaller increments by adding new
You can see how the endless variety afforded by two or more such scripts might relieve some of your viewer fatigue stress. Just be sure the possible combinations coordinate nicely. Then go directly to the airport and bring small bills for the nice stewardess.
Holly Cunningham, a frequent contributor to CNET Builder.com, is a freelance Web designer who works primarily to keep her Chihuahua in furs.