What I am trying to do is create a footer on all my pages under my root folder that contains certain information, especially the last modified date of the page. I have got the code working to get the last modified date (using javascript). I put the javascript code (posted at end) in the OnRequestEnd.cfm file on the top root, and it works, just not the way I want it. Instead of giving the last date modified of the page loaded, it gives the last modified date of the OnRequestEnd.cfm file. If anyone has any help or suggestions I would appreciate it. The following is my OnRequestEnd.cfm
Keith
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<!---script
type="text/JavaScript"
language="JavaScript">
<!--
//
// format date as dd-mmm-yy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getYear();
// handle different year values
// returned by IE and NS in
// the year 2000.
if(y >= 2000)
{
y -= 2000;
}
if(y >= 100)
{
y -= 100;
}
// could use splitString() here
// but the following method is
// more compatible
var mmm =
( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
(10==m)?'Oct':(11==m)?'Nov':'Dec';
return "" +
(d<10?"0"+d:d) + "-" +
mmm + "-" +
(y<10?"0"+y:y);
}
//
// get last modified date of the
// current document.
//
function date_lastmodified()
{
var lmd = document.lastModified;
var s = "Unknown";
var d1;
// check if we have a valid date
// before proceeding
if(0 != (d1=Date.parse(lmd)))
{
s = "" + date_ddmmmyy(new Date(d1));
}
return s;
}
//
// finally display the last modified date
// as DD-MMM-YY
//
document.write(
"<center>This page was updated on " +
date_lastmodified() + "</center>");
// -->
</script--->
</body>
Keith
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.