Handy code snippets
| Handy code snippets | |
05 August 2005
You can do both of these tricks by adding the following concise JavaScript snippets to your page code. To add a simple time feature paste this script into the Head tag of the page:
Next, paste the code below into the <body> tag.
Finally, add the code below where you want the clock to appear on the page.
One good reason to add a clock to your site is that it instantly tells site visitors the time zone in which you’re operating. With a .com domain, for instance, it is not immediately obvious where the company is based. It could just as easily be Aberdeen in Scotland or Aberdeen in South Dakota, a distance of some 2000 miles and a seven hour time difference, factors that will affect how quickly an order may be dispatched or an email enquiry answered. Meanwhile, to add a ‘Page last updated’ feature paste the following code into the foot of the page:
This small script informs users how up to date and relevant the information is. It sits best on a page that changes frequently or which contains time sensitive content. Avoid adding to pages that are static as it will then imply the site has gone into hibernation or worse. | |
