Need a script that gives the datestamp of a file from the server rather than the datestamp of the file in the local cache (which always turns out to be today's date).
This is the script I've been given:
// Script Start
var docdate = new Date(document.lastModified);
var month = docdate.getMonth();
if (month == 0) var monthstr = "January";
if (month == 1) var monthstr = "February";
if (month == 2) var monthstr = "March";
if (month == 3) var monthstr = "April";
if (month == 4) var monthstr = "May";
if (month == 5) var monthstr = "June";
if (month == 6) var monthstr = "July";
if (month == 7) var monthstr = "August";
if (month == 8) var monthstr = "September";
if (month == 9) var monthstr = "October";
if (month == 10) var monthstr = "November";
if (month == 11) var monthstr = "December";
var year = docdate.getYear()
if (year < 1000) {
year = year + 1900;
}
document.write(
"<span class=update>Updated: "
+ docdate.getDate() + " "
+ monthstr + " "
//
+ year + " </span>"
);
// Script End
This script gives the date of the file in the local cache rather than the date from the server. Any suggestions?
This is the script I've been given:
// Script Start
var docdate = new Date(document.lastModified);
var month = docdate.getMonth();
if (month == 0) var monthstr = "January";
if (month == 1) var monthstr = "February";
if (month == 2) var monthstr = "March";
if (month == 3) var monthstr = "April";
if (month == 4) var monthstr = "May";
if (month == 5) var monthstr = "June";
if (month == 6) var monthstr = "July";
if (month == 7) var monthstr = "August";
if (month == 8) var monthstr = "September";
if (month == 9) var monthstr = "October";
if (month == 10) var monthstr = "November";
if (month == 11) var monthstr = "December";
var year = docdate.getYear()
if (year < 1000) {
year = year + 1900;
}
document.write(
"<span class=update>Updated: "
+ docdate.getDate() + " "
+ monthstr + " "
//
+ year + " </span>"
);
// Script End
This script gives the date of the file in the local cache rather than the date from the server. Any suggestions?
Comment