Solved

Back button clicked

Posted on 2001-07-06
6
195 Views
Last Modified: 2009-07-29
How do I know when the Back button on the browser has been clicked?
0
Comment
Question by:skwalsh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Expert Comment

by:Yog
ID: 6259222
When the user clicks the back button, you are already in the previos page or specified page and so you cant trap. You can capture the URL, and query params..at the top of eah page and will come to know if the user is in the same page or different..What finally you want to do
0
 
LVL 4

Expert Comment

by:epeele
ID: 6259423
If you want to "prevent" usage of the back button, you can add the following to your pages to force the browser to the most recent page in the history.  While you can't actually disable the back button, this effectively "disables" the back button by providing the same result of keeping the user on the current or subsequent pages.  

<script language=javascript>
  window.history.forward();
</script>
0
 
LVL 5

Expert Comment

by:Yog
ID: 6259440
hmm, if disabling back button is what you want answer is here
http://developer.irt.org/script/1522.htm
but you cant trap wheather the user clicked the back button - can do only as i said in my previour comment.

cheers.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Accepted Solution

by:
Silvers5 earned 25 total points
ID: 6259835
you can't.. but you can disable the back button as said above  more info:

You can't do it directly, but her's a work around:

<SCRIPT LANGUAGE=javascript>
{
 var Backlen=history.length;
 history.go(-Backlen);
 top.window.location.href ="YourPage.asp";
}
</SCRIPT>

or this:

<body OnLoad="window.history.forward();">

this way you disable the ability to move backwards.


also check this issue:

http://www.4guysfromrolla.com/webtech/111500-1.shtml
0
 
LVL 2

Expert Comment

by:Lunchy
ID: 6375912
Hi skwalsh

In the interest of maintaining the database of questions, it would be good if you could resolve your question.  Your options at this point are:

1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.

2. Award points to multiple experts--If you wish to award multiple participants, you can do so by creating a zero point question in the Community Support topic area, include this link and tell them which experts you'd like to award what amounts.

3. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

4. Delete the question because it is of no value to you or to anyone else. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

If you elect for option 2, 3 or 4, all you need to do is post right here as a comment, and I will take care of the rest.

PLEASE DO NOT AWARD THE POINTS TO ME. We also request that you review any other open questions you might have and deal with them as necessary.

Lunchy
Friendly Neighbourhood Community Support Moderator
Community Support:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
0
 
LVL 2

Expert Comment

by:Lunchy
ID: 6395148
Force acceptance of Silvers5's comment
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question