Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2004
    Location
    London, England
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    newbie. detecting 2nd and subsequent page loads in onload()

    I use onload() to set what's visible and what's not on a page. Users may click various things on the page to customise what's visible. When they select other pages, then use 'back' to come back to me, the onload() resets all their changes.

    Is there a standard way to detect either (a) the first time a page is loaded or (of course) 2nd and subsequent times within a session? It doesn't need to be across complete sessions, so a cookie isn't needed.

    Sorry if this is a well known or RTFM problem.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Once a page is closed (directly or by passing to another page in the same window), the session for that page is closed, so the changes you are talking about are lost. I suggest you to find a server-side application (php, asp, etc...) not to use javascript which is a client-side language...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could use a session cookie or store the variables on the window.name


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •