尝试执行此操作,这正在执行默认行为。
window.addEventListener('beforeunload', this.beforeUnloadFunc);
function beforeUnloadFunc(e) {
e.preventDefault();
e.returnValue = '';
return null;
}
答案 0 :(得分:0)
您可以尝试一下!
document.onkeydown = function() {
if(event.keyCode == 116) {
event.returnValue = false;
event.keyCode = 0;
return false;
}
}
来源 https://www.codeproject.com/Questions/243851/How-to-disable-back-forward-and-Refresh-functional