View Full Version : newbie. detecting 2nd and subsequent page loads in onload()

Roy Gardiner
06-02-2004, 12:09 PM
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.

06-02-2004, 01:18 PM
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...

Willy Duitt
06-02-2004, 01:19 PM
You could use a session cookie or store the variables on the window.name