Link to home
Start Free TrialLog in
Avatar of skwalsh
skwalsh

asked on

Back button clicked

How do I know when the Back button on the browser has been clicked?
Avatar of Yog
Yog

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
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>
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.
ASKER CERTIFIED SOLUTION
Avatar of Michel Sakr
Michel Sakr
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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:
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
Force acceptance of Silvers5's comment