A
Ade
Hi,
I posted a similar question a couple of months ago but didn't get anywhere
near the amount of responses as that last thread but what i did get was very
useful to me so thanks for that.
In addition to obtaining the date last updated, I wanted to update a
particular frame on my page with the information from the file being loaded
into the pages 'main' frame. I put a link to the following function in every
page that may be loaded into the main frame with an onLoad="show_updated();"
in the <body> tag...
function show_updated()
{
dm = new Date (document.lastModified);
str_months = "JanFebMarAprMayJunJulAugSepOctNovDec";
offset = dm.getMonth() * 3;
this_month = str_months.substring(offset,offset+3);
hr = dm.getHours();
mn = dm.getMinutes();
pm = "am";
if (mn < 10) mn = "0" + mn;
if (hr > 11) pm = "pm";
txt = ("Page updated: <br>" + dm.getDate() + "-" + this_month
+ "-" + dm.getFullYear() + " " + hr + ":" + mn + pm);
window.top.UPDATED.document.getElementById("dateupdated").innerHTML = txt;
}
Sometimes it works and sometimes it doesn't. When it fails, it generally
shows the current date and time (??). I can't be any more specific I'm
afraid. Can anybody suggest why or suggest a better way of attempting this?
Thanks,
Ade
I posted a similar question a couple of months ago but didn't get anywhere
near the amount of responses as that last thread but what i did get was very
useful to me so thanks for that.
In addition to obtaining the date last updated, I wanted to update a
particular frame on my page with the information from the file being loaded
into the pages 'main' frame. I put a link to the following function in every
page that may be loaded into the main frame with an onLoad="show_updated();"
in the <body> tag...
function show_updated()
{
dm = new Date (document.lastModified);
str_months = "JanFebMarAprMayJunJulAugSepOctNovDec";
offset = dm.getMonth() * 3;
this_month = str_months.substring(offset,offset+3);
hr = dm.getHours();
mn = dm.getMinutes();
pm = "am";
if (mn < 10) mn = "0" + mn;
if (hr > 11) pm = "pm";
txt = ("Page updated: <br>" + dm.getDate() + "-" + this_month
+ "-" + dm.getFullYear() + " " + hr + ":" + mn + pm);
window.top.UPDATED.document.getElementById("dateupdated").innerHTML = txt;
}
Sometimes it works and sometimes it doesn't. When it fails, it generally
shows the current date and time (??). I can't be any more specific I'm
afraid. Can anybody suggest why or suggest a better way of attempting this?
Thanks,
Ade