Disable back button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abhishekbrave
    New Member
    • Dec 2007
    • 79

    Disable back button

    Is it possible to disable back button of a browser in java script.

    Any pointers will be very helpful so that I can do some workaround on the same
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    This is a common question and the answer is that you can't reliably disable the back button. There's no need to either. The first question to ask yourself is why you want to do it. If the page is being cached after logout, prevent page caching. If unsaved data is being lost, use onbeforeunload to ask the user if they're sure they want to leave the page.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      That has been asked here several times. See this thread and this one.

      Edit: Too slow.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Ha, no fuss. Those links should provide more information/links. Also goes to show what a quick search can give you.

        Comment

        Working...