html tutorials web design help css tutorials free web graphics diy search engine optimization

Web Page Last Updated Script

This script will place a Page Last Updated notice on your page. No one can figure out how it works, it's just magic. Here's an example of it:

If you study the script below you can see how I added style code to it so you can format the text to fit your site. The important thing to note is that I enclosed the property and value for the division selector in single quotation marks instead of the usual double quotation marks. If you use double quotation marks in the script where they don't belong it breaks the script.

You can also change the wording that prefaces the generated date. Just be careful when you modify the script. Do one thing at a time and test it so if it breaks you'll know exactly what broke it.

Get a Date

<script type="text/javascript">
// script from BoogieJack.com
var m = "Page Last Updated " + document.lastModified;
var p = m.length-8;
document.writeln("<div style='font-size: 12px;'>");
document.write(m.substring(p, 0));
document.writeln("</div>"); 
</script>
Just paste that into the place on your page where you want it to appear and you've got a date. Hey, it beats hanging out in bars looking for one.
Back | Web Design Tutorials Index

Ezine for Webmasters

Bookmark and Share

Almost a Newsletter

Changing list hosts. Will post a new subscribe form shortly.

Did you know...

The member's site has about 100 standards compliant HTML and CSS tutorials, 31 handy reference charts, reprintable content, web graphics, exclusive fonts, free software, free ebooks and more? All this for less than 9 cents a day! [ Details ]
See my fancy bottom! :)