SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2007
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Disabling browser back button

    Is it possible to disable the back/forward buttons/history in javascript without hiding those browser controls? I work on a web app that tends to throw errors in certain situations and there is some resistance in hiding those controls.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,813
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Those conjtrols belong to your visotir and you can't stop them using them if they want to. Even if you hide them (which only some browsers allow) that will not necessarily stop them using them as there are also keyboard equivalents.

    The best solution is to reprogram your application to allow for it and if you can't do that then ask your visitors not to use those options.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2007
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Reprogramming the app certainly won't happen. We tell users in training not to use the back button and the feedback I've received is they're not really web savvy so I'm guessing most don't know keyboard navigation or right click, back.

    Oh well!

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by magenta placenta View Post
    Is it possible to disable the back/forward buttons/history in javascript without hiding those browser controls? I work on a web app that tends to throw errors in certain situations and there is some resistance in hiding those controls.
    I propose that the web app should be built so that it doesn't crash when standard browser navigation techniques are used.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •