473,320 Members | 1,799 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,320 software developers and data experts.

How to detect when user presses browser back buttons

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 a simple mechanims
thru JS.

Thanks
CK

Jul 20 '05 #1
1 11160
In article <3F**************@oracle.com>, "Jeyaprakash(CK) Chittu"
<CK************@oracle.com> writes:
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 a simple mechanims
thru JS.


No. Javascript has no way of knowing if I click on the Back button. It can only
know that I am leaving/have left the page, but not how I left it.

If you are trying to track data, then you need to approach it differently. Any
JS approach will fail when its disabled/not available.

The only way that I know of, that will ensure a reload, is to make the URL
unique each time. The simplest way to do that is to append the current time to
the page, and then check it when the page loads. If its over XXX milliseconds
old, then redirect it back to itself, with the new time appended.

--
Randy
Jul 20 '05 #2

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

Similar topics

6
by: Rune | last post by:
Hey I'm trying to build a gui application and need to know if the user is actually holding down the shift or ctrl key. That is, if the user currently is holding down the shift key. In pseudo...
157
by: Dennis | last post by:
Is there some way --using, say, DOM or javascript-- to detect the current pixel width and/or height of a relatively sized table or of one of its columns or rows. I'm going to be writing javascript...
0
by: Jesper Lauridsen | last post by:
I am developing an ASP.NET application for a Questionnaire that spans over several pages. The entire Questionnaire code resides in one ASPX page. When a user submits a questionnaire page by...
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
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
3
by: Lord2702 | last post by:
Sat. Oct. 30, 2004 3:25 PM PT I want to detect, if user has close the browser, (after logging to my site), that user has closed the browser. How to achieve it ? I want to know this close action...
3
by: Tea Maker | last post by:
Hi, I was wondering if there's a way to call a function when a user presses on the "back" or "forward" buttons of the browsers. What I want is, redirect the user to a new website (let's say...
4
by: wqmmnm | last post by:
How can I detect when a user presses buttons on a php site
12
by: Daniel Klein | last post by:
I'm pretty new at php and web stuff so please be gentle with me. I'm trying to get a form to submit when the user presses the Enter key. I do not want to use javascript. I've googled this to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
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...
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.