Pages

Tuesday, July 30, 2013

Automatically modifying the modify date

Do you ever want to automatically add a modification date to a web page? It's easy - just locate the area where you want to place the modification note and insert the following script:

<script language="JavaScript">
document.write("The last time we got off our duffs and updated this page was on " + document.lastModified)
</script>

Obviously, you can change the text within the script to match your witty personality. Then, each time you save the page, the lastModified element is changed. Be forewarned that this won't work too well in pages that use server-side includes (SSI), since these pages are "updated" each time they're served to a browser.


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.