| ★ wanayoo — archive 1999 http://webdeveloper.com/drweb/97Feb03-drwebsite.html | Nouvelle recherche | Portail wanayoo |
![]()
Easy Ways to Automate Your Page-Update Notice
By Dr. Website Dear Dr. Website®: I want to let visitors know at a glance how recently the pages on my site were changed, but it's tiresome to change the "last updated" notification by hand. Is there an easy way to make a page automatically display the date it was revised? It's become fairly common to place a "Last modified" date somewhere on Web pages. But as you've discovered firsthand, it's inefficient to modify the date manually and it's very easy to forget to change that date at all.There are several ways you could automate this function. First, you could include a JavaScript script that will automatically place the modified date into your HTML pages and continue to change the date whenever you edit the file. Here's one simple script that accomplishes this:
<SCRIPT LANGUAGE="JavaScript">This should generate a line that reads something like this:<--hide from non-JavaScript browers
modified=+document.lastModified);
// end hiding--></SCRIPT>
Last modified: Jan 29 15:27:03 1997This is a simple script, but you can find many freely available JavaScript scripts online that suggest alternatives for formatting the date and time.A couple of good resources for useful JavaScript tricks with source code include Gamelan's JavaScript section and the JavaScript Index.
Depending on what Web server you're using, you can also use server-side includes, a capability that gives you great flexibility in including information in your HTML files dynamically. However, server-side includes cause your Web documents to be processed by the server, so they are slower to load and could unduly increase network traffic.
Finally, some HTML management tools, like Microsoft's FrontPage, include functionality for date- or time-stamping pages.
Creating Index Colored Palettes
Dear Dr. Website®: I've heard that reducing the number of colors in a graphic can make the file size smaller, and that making all my graphics use the same set of colors will make my pages load even faster. How do you limit what colors are available to choose from? I'm using DeBabelizer to save graphics.If you use the same set of colors for designing all the graphics on your site, you can imbue all your Web pages with a smart, color-coordinated look. Your pages will also display more quickly if all the colors used fit within a single 256-color palette, to accommodate Web visitors who have 8-bit color monitors.
Graphics programs like DeBabelizer and Adobe Photoshop let you create and save indexed color palettes. An easy way to do this is if you have a series of images that you want to map to the same indexed color mode.
In DeBabelizer, you can create a new indexed color palette based on the colors in a single image, then open up additional images and factor in extra colors to weight the averages toward specific or predominant colors.
In Photoshop, one way to create a well-balanced color palette is to take a couple of pictures in a series-generally, the two most highly contrasting images-and combine them side by side in a larger, encompassing temporary image. Then, from the larger image, you can define an indexed palette; since it draws on a wide range of colors, you'll get fewer changes when you map all the images to the new indexed color palette.
Reprinted from Web Week, Volume 3, Issue 2, February 03, 1997 © internet.com Corporation All rights reserved. Keywords: html site_management Date: 19970203
![]()