2
可能重複:
How to customize (or disable) the automatic 「back」 button in JQueryMobile如何jquerymobile禁用後退按鈕
你好我試圖建立一個網頁,移動在我的要求是
用戶首先從頁面A轉到頁面B,然後他不能通過單擊瀏覽器的後退按鈕將頁面轉到頁面B.
可能重複:
How to customize (or disable) the automatic 「back」 button in JQueryMobile如何jquerymobile禁用後退按鈕
你好我試圖建立一個網頁,移動在我的要求是
用戶首先從頁面A轉到頁面B,然後他不能通過單擊瀏覽器的後退按鈕將頁面轉到頁面B.
,如果你想避免在使用瀏覽器的後退按鈕回到之前的頁面
<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