Solved

Back button clicked

Posted on 2001-07-06
6
190 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now