【问题标题】:how to disable back button in jquerymobile [duplicate]如何在jquerymobile中禁用后退按钮[重复]
【发布时间】:2012-05-14 01:28:39
【问题描述】:

可能重复:
How to customize (or disable) the automatic “back” button in JQueryMobile

您好,我正在尝试为我的要求开发一个移动网页

用户首先从页面A转到页面B,然后他不能通过点击浏览器的后退按钮回到页面B。

【问题讨论】:

    标签: jquery jquery-mobile


    【解决方案1】:

    如果你想防止使用浏览器返回按钮返回上一页,你可以使用这个代码sn-p

    <head>
    <script type="text/javascript">
        window.history.forward();
        function noBack() { window.history.forward(); }
    </script>
    </head>
    <body onload="noBack();"
        onpageshow="if (event.persisted) noBack();" onunload="">
    

    实际来源-http://viralpatel.net/blogs/2009/11/disable-back-button-browser-javascript.html

    【讨论】:

      猜你喜欢
      • 2011-08-06
      • 1970-01-01
      • 1970-01-01
      • 2014-04-09
      • 2011-04-06
      • 2011-07-28
      • 2011-12-19
      • 2021-01-30
      • 2013-11-24
      相关资源
      最近更新 更多