How to detect when user went back to page

F

Flarky

Hi all,

I have a page that has links to other pages.
I want to be able to detect when the user has clicked
on Back (or typed Backspace) to move back to my page.
Is this possible?

Thanks.
 
P

Paul

Randy said:
Flarky said the following on 1/10/2007 5:28 PM:

No. rather uncreative

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Not 100% but, you could have pages add navigation tracking to a
(session) cookie. Then just read/parse the cookie on visits to the
page. Even when reading, its not 100% that the user simply hit back,
they may have jumped 'back' several pages, or even retyped the url but,
as long as you are careful with the user experience user's on the
fringe should not be adversely affected.
 
R

Randy Webb

Paul said the following on 1/10/2007 8:12 PM:
rather uncreative

But 100% true none the less
Not 100% but,

The solution you call "creative" *might* be 10% reliable.
you could have pages add navigation tracking to a (session) cookie.

It won't read the cookie on page load via the Back button.
Even when reading, its not 100% that the user simply hit back,

That's providing it even reads the cookie 10% of the time.
 
P

Paul

Randy said:
Paul said the following on 1/10/2007 8:12 PM:

But 100% true none the less


The solution you call "creative" *might* be 10% reliable.
Haven't done this in a while but, experience showed 95% when the QA
dept checked with Win95/98/ME/2K/NT with IE4,5,5.5 NS4,4.5,4.7,6 Opera
5,6,7; Mac OS7,8,8.5,9 w/ IE and NS
Assumes script enabled of course.
It won't read the cookie on page load via the Back button.
Actually, yes, it can.
var rawCookie = document.cookie;
That's providing it even reads the cookie 10% of the time.
With JS enabled, there is little prob reading a cookie, even if the
page came out of the cache.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top