<script> document.onkeydown = function (e) {//键盘按键控制 e = e || window.event; if ((e.ctrlKey && e.keyCode == 82) || //ctrl+R e.keyCode == 116) {//F5刷新,禁止 setTimeout(function () { alert('按下F5或者CTRL+R'); }, 100);//延时提醒,要不alert会导致return false被alert挂起从而浏览器执行了刷新 return false } } document.write(new Date().getTime()) </script>
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/14022.html