如何使用JavaScript禁用Firefox上的后退按钮 [英] how to disable back button on firefox using javascript
本文介绍了如何使用JavaScript禁用Firefox上的后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用javascript
how to disable back button on firefox using javascript
推荐答案
尝试此操作
禁用浏览器后退按钮 [
try this
Disable browser back button[^]
亲爱的朋友,
识别后退键",键事件并禁用它们.
在这里,我给出了显示F5键的示例代码.
Dear Friend,
Identify the Back Keys, key event and disable the same.
Here I have give a sample code to display the F5 key.
document.onkeydown = function(e) {
// keycode for F5 function
if (e.keyCode === 116) {
return false;
}
// keycode for backspace
if (e.keyCode === 8) {
// try to cancel the backspace
return false;
}
};
如果要从浏览器隐藏后退按钮,则可以通过调用子窗口来隐藏工具栏.
EG:
newwindow = window.open(url,'''',''toolbar = no,location = no,menubar = no,scrollbars = yes'');
If you want to hide the back button from the browser, then you can hide toolbar by calling the child window.
EG:
newwindow=window.open(url,'''',''toolbar=no,location=no,menubar=no,scrollbars=yes'');
hiii,
hiii,
<SCRIPT type="text/javascript">
window.history.forward();
function disableBack()
{
window.history.forward();
}
</SCRIPT>
</HEAD>
<BODY onload="disableBack();" onpageshow="if(event.persisted) disableBack();">
这篇关于如何使用JavaScript禁用Firefox上的后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文