Disable browser's back button

后端 未结 20 1660
猫巷女王i
猫巷女王i 2020-11-22 04:27

How to disable browser\'s BACK Button (across browsers)?

20条回答
  •  天涯浪人
    2020-11-22 05:20

    While i'm looking for the answer myself, "Best Practice" is.... outdated... Just like browsers are.(Really browsers are ugly fossils)

    The best/safest solution would be for browsers to implement a method/request where the user can grant the page the ability to control the interface.

    Why? Because for my current project i'm building a 100% JavaScript built and controlled interface.. And back button's have no place in my project since there is no page change. (Ie bloody fast and no page-flashes because of a refresh.. Just like a real application!)

    I know why the ability to "highjack" the interface isn't there, and i understand it. But atleast we should have the ability to request it from the browser! Now that would truly be "best practice" without the highjack dangers.

    But browsers being browsers.. I don't expect anything exiting to happen in this regard.

提交回复
热议问题