last modified script question

S

Svetac

Hi,
I use a script that shows when the page was last modified. It works fine
for just one html file. The thing I would like to do is that the
script shows me of last modified file in root directory. For example if
I change something in gallery.html or feed.xml, I would like to see that
date of change in index.html under last modified date. Could someone
help me please. Thanks in advance.

The script that I use now:

<!--
function getLongDateString()
{ //method defined on class Date.
//Returns a date string of the form: Day DD Month,YYYY
//(e.g. Sunday 27 September, 1998)
monthNames = new
Array("January","February","March","April","May","June","July","August","September","October","November","December");
dayNames = new
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
dayOfWeek = this.getDay();
day = dayNames[dayOfWeek];
dateOfMonth = this.getDate();
monthNo = this.getMonth();
month = monthNames[monthNo];
year = this.getYear();
if (year < 2000)
year = year + 1900;
dateStr = day+", "+dateOfMonth+" "+month+" "+year;
return dateStr;
}
//register the method in the class Date
Date.prototype.getLongDateString=getLongDateString;

function DocDate()
{ //return the document modification date (excl.time)
//as a string
DateTimeStr = document.lastModified;
secOffset = Date.parse(DateTimeStr);
if (secOffset == 0 || secOffset == null) //Opera3.2
dateStr = "Unknown";
else
{
aDate = new Date();
aDate.setTime(secOffset);
//use method defined above
datestr = aDate.getLongDateString();
}
return dateStr;
}

document.write("Last change: ");
document.writeln(DocDate(), "");
// -->
 
P

Peter Michaux

Hi,
I use a script that shows when the page was last modified. It works fine
for just one html file. The thing I would like to do is that the
script shows me of last modified file in root directory. For example if
I change something in gallery.html or feed.xml, I would like to see that
date of change in index.html under last modified date. Could someone
help me please. Thanks in advance.

You don't determine the last modified file in the root directory from
the client-side. This is something you do server-side and print the
last modified date into the page.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,008
Messages
2,570,270
Members
46,872
Latest member
Stephendes

Latest Threads

Top