Web Analytics Made Easy -
StatCounter Stop user from using the back button - CodingForum

Announcement

Collapse
No announcement yet.

Stop user from using the back button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stop user from using the back button

    Without changing the window to not include the menu bar that has the back button on it, is there a way to make javascript disable the back button, or stop the page change when it is hit?

    THanks.
    If I'm postin here, I NEED YOUR HELP!!

  • #2
    In short no. and even if you could they could still use the backspace key. IF it is a specific page you are try to prevent them from going back to tehn you can prevent access from a back opereation by doint the body tag this way:

    <body onload="history.forward()">

    It is an ugly hack. I don't recommend it. If your design is dependent on disabling browser functionality and limiting the user; then you real problem is in the design. You need a design that works without requiring violating best practices and leaving the users controls alone.
    100% standards compliant code is 100% correct 100% of the time.

    Cd&

    Comment

    Working...
    X