Last Modified problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amanda

    Last Modified problems

    Hi, hope you can help me with this one.

    If I want to get the date a page has been last modified, I can do something
    like ..

    document.write( "<b>Last updated: "+document.last Modified+"</b>");

    Can I use this to display the date that other pages were last modified - eg
    other pages on my website?
    I want my index.htm to display the last modified date of other pages on the
    website without me manually updating.

    Thanks!



  • Dr John Stockton

    #2
    Re: Last Modified problems

    JRS: In article <bdn77t$ba5$1@h ercules.btinter net.com>, seen in
    news:comp.lang. javascript, Amanda <ads1980@hotmai l.com> posted at Sun,
    29 Jun 2003 17:22:05 :-
    [color=blue]
    >If I want to get the date a page has been last modified, I can do something
    >like ..
    >
    >document.write ("<b>Last updated: "+document.last Modified+"</b>");[/color]

    If you use that form on the Web, some browsers will display the American
    date format, even to users in Europe. So only modify when, in the date,
    D=M or D>12. Moreover, the year may be two-digit, and Easterners read
    dates with year first.

    [color=blue]
    >Can I use this to display the date that other pages were last modified - eg
    >other pages on my website?
    >I want my index.htm to display the last modified date of other pages on the
    >website without me manually updating.[/color]

    It is in fact not the date that the file was last "really" modified, but
    the date of the last upload or change that lastModified contains. It is
    IMHO better to use a more subtle scheme, such as editing manually or by
    running a local program [+], to record when the last change that the
    reader needs to know about was made, and to do so unambiguously - e.g.
    2003-06-30 or 2003 Jun 30.

    See <URL:http://www.merlyn.demo n.co.uk/js-date3.htm#lM> about
    lastModified.

    I don't know a way to get the lastModified of another page[*], which
    suggests that there may not be a reasonable one.

    [+] DOS Batch program up-dates.bat, to be uploaded into directory
    <URL:http://www.merlyn.demo n.co.uk/programs/>, uses other programs HUNT,
    COLS, EKKO, NOWMINUS in that directory to generate an HTML page
    alphabetically listing *.htm files and dates for the current directory.
    Possibly to be developed. Currently gives (format adaptable) lines like
    <li> 2003/06/19-18:55:50 &#160; <a href="batfiles. htm">BATFILES.H TM</a>
    Note : 8.3 filenames ONLY (for LFN, modify to use DOS dir command).
    [*] One might be able to load that other page into a frame, and access
    its lastModified, but that would require loading the other page in full,
    probably largely defeating the object of the exercise.

    --
    © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk DOS 3.3, 6.20; Win98. ©
    Web <URL:http://www.merlyn.demo n.co.uk/> - FAQqish topics, acronyms & links.
    PAS EXE TXT ZIP via <URL:http://www.merlyn.demo n.co.uk/programs/00index.htm>
    My DOS <URL:http://www.merlyn.demo n.co.uk/batfiles.htm> - also batprogs.htm.

    Comment

    Working...