Click to See Complete Forum and Search --> : Last Updated


spinnyscripter
10-19-2003, 01:27 PM
Is There any way That i can have page lase updated date automaticly update*

Well i say automaticly i am willing to edit a file but not all of the apage i was thinkiing a .JS file where i edit a set of variables and the page has a differnt updated page link on it by using
document.write(page*)
Where * is the page number say i have 10 pages i will have page numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 110 all as variables.

All the variables will come from a ouside file called update.js that is linked to the web page.

i was just wondering would the basic outline of this work i kn0w that the script will need tweeking a bit .
Thanks Daniel
:confused:

sciguyryan
10-19-2003, 02:00 PM
actually yes, the document lastModified method will do that:

var LastMod = document.lastModified()
document.write(+LastMod)


That should do the trick.

fredmv
10-19-2003, 06:13 PM
Originally posted by sciguyryan
the document lastModified method will do that Just to clear things up, lastModified isn't a method; it's a property. So the code would actually look something like this:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>untitled</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<script type="text/javascript">
/*<![CDATA[*/
document.writeln( document.lastModified );
/*]]>*/
</script>
</head>
<body>
<div></div>
</body>
</html>I hope that helps you out.

Charles
10-19-2003, 07:01 PM
However, you may not like the date format that you get that way. If so then try instead:

document.write(new Date(document.lastModified).toLocaleString())

or

document.write(new Date(document.lastModified).toDateString())

spinnyscripter
10-20-2003, 08:10 AM
Thanks, Taht helped a lot i used the bottom document.write bit instead as that was the format i was looking for

if you want to see an example the visit my website.

Daniel :cool: