Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript for updating dates on file upload

Status
Not open for further replies.

DBSSP

Programmer
Apr 1, 2002
327
US
I have small problem figuring out how to make dates next to links change. I basically need the code to look at when the creation date of the file and change the diplayed "last update" date to the the same value.

I tried using .lastmodified, but that's only good for the webpage it's in. Any ideas? Can javascript even do this?

Jay [infinity]
"If the words up and down were reversed, would you trip and fall or trip and fly?"
 
>> Can javascript even do this?

Certainly not pure JavaScript. However, using IE, you could use the MSXML HttpRequest object to extract the Last-Modified date out of the request headers.

Have a play with this:
[tt]
function getLastModified(strURL){
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
xmlhttp.open("GET", strURL, false);
xmlhttp.send();
alert(xmlhttp.getResponseHeader("Last-Modified"));
}
[/tt]
 
Thanks for the help, but I forgot about SSI...Doh! One little line. *sigh* guess that's what happens when you have to multi-task, eh? :p



Jay [infinity]
"If the words up and down were reversed, would you trip and fall or trip and fly?"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top