点击F5 ...
时如何停止加载页面谢谢&问候
鲁比娜
答案 0 :(得分:1)
对于IE和FireFox
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Block F5 Key In IE & Mozilla</title>
<script language="JavaScript">
var version = navigator.appVersion;
function showKeyCode(e) {
var keycode = (window.event) ? event.keyCode : e.keyCode;
if ((version.indexOf('MSIE') != -1)) {
if (keycode == 116) {
event.keyCode = 0;
event.returnValue = false;
return false;
}
}
else {
if (keycode == 116) {
return false;
}
}
}
</script>
</head>
<body onload="JavaScript:document.body.focus();" onkeydown="return showKeyCode(event)">
</body>
</html>
答案 1 :(得分:0)
尝试以下方法来禁用location.reload(),方法是将其覆盖为:
location.reload = function() {return false;}
但这可能有其他副作用......