How do I disable the 'back' button and cause a pop up box to appear when its clicked?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ellyyra
    New Member
    • Apr 2010
    • 2

    How do I disable the 'back' button and cause a pop up box to appear when its clicked?

    Can someone please tell me how to do this using Javascript:

    When user clicks the 'Back' button at the top of a browser a pop up box comes up telling them "Don't be a cheat." When they click okay, cancle, close - whatever - they remain on the page they were before.

    Thank you in advance.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    This is unsafe browser behaviour. You'd have to instead save state somewhere on your server to make a page load up differently than before.

    Comment

    Working...