473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to detect when user went back to page

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.

Jan 10 '07 #1
4 2945
Flarky said the following on 1/10/2007 5:28 PM:
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?
No.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 11 '07 #2

Randy Webb wrote:
Flarky said the following on 1/10/2007 5:28 PM:
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?

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.

Jan 11 '07 #3
Paul said the following on 1/10/2007 8:12 PM:
Randy Webb wrote:
>Flarky said the following on 1/10/2007 5:28 PM:
>>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?
No.
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.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 11 '07 #4

Randy Webb wrote:
Paul said the following on 1/10/2007 8:12 PM:
Randy Webb wrote:
Flarky said the following on 1/10/2007 5:28 PM:
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?
No.
rather uncreative

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

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.
you could have pages add navigation tracking to a (session) cookie.

It won't read the cookie on page load via the Back button.
Actually, yes, it can.
var rawCookie = document.cookie;
>
Even when reading, its not 100% that the user simply hit back,

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.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeyaprakash(CK) Chittu | last post by:
Hi I have couple of pages that maintain some stateful information and i need to detect browser back button press and refetch the page in order to show the current values on the fields. Is there...
23
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I...
12
by: |-|erc | last post by:
when a user clicks back to get to my site, I want it to run a javascript function. can you detect when the FORWARD button is greyed out? Herc -- I call3d this fugly and I'm proud...
3
by: Hardy Wang | last post by:
Hi, I have a HttpModule in my ASP.NET application, in AuthorizeRequest event, I want to detect if page is posted back. Is there a way? using System; using System.Web; namespace MyModule {...
6
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
4
by: Dst | last post by:
This is what i'm trying to do: I'm porting a windows app to a web app. I have a webform which will edit some data stored in a database. The data needs to be locked in the database, while editing....
1
by: =?Utf-8?B?SmVycnkgSg==?= | last post by:
I have an aspx page that normally gets called via an HTTP Post from another web page. For example, the calling page (page1.aspx) calls page2.aspx with a querystring from javascript like so: ...
5
by: pamela fluente | last post by:
I have placed a button on a page to open a pdf stored on another site. When the user clicks on the button I do a Redirect to the pdf URL .... and this seems to work fine. Question: is this...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.