Solved

Back button clicked

Posted on 2001-07-06
6
193 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
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

820 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