ユーザーが戻るボタンを使用しないようにしようとしていますが、Chrome のタイトル バーを右クリックしてコンテキスト メニューを取得しようとするまでは、これまでのところ非常に優れていました。同じオプションがない他のページを見たことがあります。行う。
私はこのコードを使用しました:
< script type="text/javascript">
function disableBackButton() {
window.history.forward(1);
}
setTimeout("disableBackButton()", 0);
window.oncontextmenu = function() { return false }
</ script>
< script type="text/javascript">
if (typeof window.event != 'undefined')
document.onkeydown = function() {
if (event.srcElement.tagName.toUpperCase() != 'INPUT')
return (event.keyCode != 8);
}
else
document.onkeypress = function(e) {
if (e.target.nodeName.toUpperCase() != 'INPUT')
return false;
}
</ script>
< script type="text/javascript">
document.onkeydown = chkEvent
var formInUse = false;
function chkEvent(e) {
var keycode;
if (window.event) keycode = window.event.keyCode; //*** for IE ***//
else if (e) keycode = e.which; //*** for Firefox ***//
if (keycode == 8) {
return false;
}
}
</ script>
< body onload="disableBackButton();" >
やることはあまりないように思えますが、それはOSの領域ですが、誰かがこれについて知っているなら試してみる価値があります
敬具
ジョージ