page updated script

Discussion in 'Scripts' started by AlanB, Jan 20, 2013.

to remove all ads.
  1. AlanB

    AlanB New Member

    Messages:
    5
    I have been using a simple javascript "page-updated" script on a number of sites for a few years without any problem but recently I have noticed that instead of recording the date and time I saved the page before ftp'ing to the server it now records present date and time and changes everytime you refresh the web page.
    Is this a server problem?

    the script is

    document.write("Page updated: " + document.lastModified );
     
  2. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    It's because your "pages" are scripted, probably a CMS of some kind and as such are created at the moment of the request.
     
  3. AlanB

    AlanB New Member

    Messages:
    5
    Sorry, I don't know what you mean by pages are scripted or CMS...
     
  4. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    CMS = Wordpress, Joomla!, Druplal, SMF, PHPBB or similar.

    Scripted = PHP, ASP, ASP.NET, SSI, Perl, Python etc.etc.
     
  5. AlanB

    AlanB New Member

    Messages:
    5
    oh yes I see what you mean.
    All my sites are hand coded in html with seperate css pages, no CMS or any other scripts.
     
  6. chrishirst

    chrishirst Well-Known Member Staff Member

    Messages:
    2,662
    Ok so your server must not be sending a last modified header in the response.
     
  7. deadmix

    deadmix New Member

    Messages:
    13
    you can try this alternative tricks if you are not using any CMS :

    stevesouders.com/blog/2012/05/22/self-updating-scripts

    Goodluck
     

Share This Page