FAQ Topic - How can I disable the back button in a web browser? (2008-04-17)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • FAQ server

    FAQ Topic - How can I disable the back button in a web browser? (2008-04-17)

    -----------------------------------------------------------------------
    FAQ Topic - How can I disable the back button in a web
    browser?
    -----------------------------------------------------------------------

    You can't. The browser's history cannot be modified. However, you
    can use ` location.replac e(url); ` in some browsers to replace
    the current page in the history.

    The replace() method of the Location interface replaces the current resource with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session History, meaning the user won't be able to use the back button to navigate to it. Not to be confused with the String method String.prototype.replace().





    --
    Postings such as this are automatically sent once a day. Their
    goal is to answer repeated questions, and to offer the content to
    the community for continuous evaluation/improvement. The complete
    comp.lang.javas cript FAQ is at http://jibbering.com/faq/index.html.
    The FAQ workers are a group of volunteers. The sendings of these
    daily posts are proficiently hosted by http://www.pair.com.

  • gunnrosebutpeace

    #2
    Re: FAQ Topic - How can I disable the back button in a web browser?(2008-04-17)

    By using appropriate cache-control http header, you can force browser
    to reload your document from server when user hits "Back", and ignore
    cached page.
    On Apr 17, 6:00 am, "FAQ server" <javascr...@dot internet.bewrot e:
    -----------------------------------------------------------------------
    FAQ Topic - How can I disable the back button in a web
    browser?
    -----------------------------------------------------------------------
    >
    You can't. The browser's history cannot be modified. However, you
    can use ` location.replac e(url); ` in some browsers to replace
    the current page in the history.
    >
    The replace() method of the Location interface replaces the current resource with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session History, meaning the user won't be able to use the back button to navigate to it. Not to be confused with the String method String.prototype.replace().

    >

    >
    --
     Postings such as this are automatically sent once a day.  Their
     goal is to answer repeated questions, and to offer the content to
     the community for continuous evaluation/improvement.  The complete
     comp.lang.javas cript FAQ is athttp://jibbering.com/faq/index.html.
     The FAQ workers are a group of volunteers.  The sendings of these
     daily posts are proficiently hosted byhttp://www.pair.com.

    Comment

    Working...