如何在 IE 和 Firefox 中禁用后退按钮? [英] How to disable Back button in IE and firefox?
本文介绍了如何在 IE 和 Firefox 中禁用后退按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须禁用浏览器的后退和前进按钮(IE 和 Firefox 两者).我试过了:
I have to disable back and forward button of browser ( IE and Firefox both ). I have tried:
//disable back button
window.onbeforeunload= function() { }
window.history.forward(1);
但这仅适用于 IE.
有没有万无一失的解决方案?
but this works only in IE.
Is there any foolproof solution?
推荐答案
答案是否定的.您无法禁用浏览器的后退按钮.
The answer is "no". You cannot disable a browser's back button.
或者至少在一个好的浏览器上.
Or at least on a good browser.
这篇关于如何在 IE 和 Firefox 中禁用后退按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文