JS - checking a file update

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

    JS - checking a file update

    Hi all,

    Sorry if this is a silly question but I've been having a heck of a hard
    time with it and hope somebody here can lend me a hand.

    I have a site with a news pages and I'd like the navigation to include a
    blinking 'NEW!' when that page has been updated within the last three days.

    It works fine for the one page (if you're on the news page, it works great)
    but I can't figure out how to check the time/date stamp on a file other
    than the one currently loaded ... any help would be greatly appreciated.

    c.

    --
  • Erwin Moller

    #2
    Re: JS - checking a file update

    Christopher wrote:
    [color=blue]
    > Hi all,
    >
    > Sorry if this is a silly question but I've been having a heck of a hard
    > time with it and hope somebody here can lend me a hand.
    >
    > I have a site with a news pages and I'd like the navigation to include a
    > blinking 'NEW!' when that page has been updated within the last three
    > days.
    >
    > It works fine for the one page (if you're on the news page, it works
    > great) but I can't figure out how to check the time/date stamp on a file
    > other than the one currently loaded ... any help would be greatly
    > appreciated.
    >
    > c.
    >
    > --[/color]

    Hi Christopher,

    This really would be a lot easier for you if you use serverside scripting
    (like PHP).
    If that is an option for you: try it.

    If that is not an option.... you will have to try a really clumbersome
    approach I am afraid, like loading all the possible pages in a hidden
    frame, get the modificationdat e, store it in a parentframe, and let JS
    query it for each page...
    I am not even sure if that will work, and it will be slow for sure.

    Please have a look at serverside scripting.
    Chances are that your current hostingprovider is offering it already with
    your current account.

    Hope this helps.

    Good luck.

    Regards,
    Erwin Moller

    Comment

    • Christopher

      #3
      Re: JS - checking a file update

      Erwin Moller
      <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> did so
      declare (news:42380290$ 0$28988$e4fe514 c@news.xs4all.n l) :
      [color=blue]
      > Christopher wrote:
      >[color=green]
      >> Hi all,
      >>
      >> Sorry if this is a silly question but I've been having a heck of a
      >> hard time with it and hope somebody here can lend me a hand.
      >>
      >> I have a site with a news pages and I'd like the navigation to
      >> include a blinking 'NEW!' when that page has been updated within the
      >> last three days.
      >>
      >> It works fine for the one page (if you're on the news page, it works
      >> great) but I can't figure out how to check the time/date stamp on a
      >> file other than the one currently loaded ... any help would be
      >> greatly appreciated.
      >>
      >> c.
      >>
      >> --[/color]
      >
      > Hi Christopher,
      >
      > This really would be a lot easier for you if you use serverside
      > scripting (like PHP).
      > If that is an option for you: try it.
      >
      > If that is not an option.... you will have to try a really clumbersome
      > approach I am afraid, like loading all the possible pages in a hidden
      > frame, get the modificationdat e, store it in a parentframe, and let JS
      > query it for each page...
      > I am not even sure if that will work, and it will be slow for sure.
      >
      > Please have a look at serverside scripting.
      > Chances are that your current hostingprovider is offering it already
      > with your current account.
      >
      > Hope this helps.
      >
      > Good luck.
      >
      > Regards,
      > Erwin Moller
      >[/color]


      Hi Erwin, thanks ... I found a solution in the end, pretty clever really.

      I run a check for a cookie on each page ... if the cookie is not present,
      I place a cookie with the current URL, and redirect them to the news
      page.

      The news page updates the value of 'last updated' and redirects them to
      the URL stored in a cookie, the whole process takes about a second the
      first time people come to the site during a 24 hour period, it's an
      intranet so traffic is controlled anyways but without access to PHP or
      ASP ... the whole process was a bit of a pain.

      THanks for your suggestion.

      c.



      --

      Comment

      Working...