1 <script type="text/javascript"> 2 //禁止用F5键 3 document.onkeydown = function (e) { 4 var ev = window.event || e; 5 var code = ev.keyCode || ev.which; 6 if (code == 116) { 7 ev.keyCode ? ev.keyCode = 0 : ev.which = 0; 8 cancelBubble = true; 9 return false; 10 } 11 } 12 //禁止右键刷新 13 document.oncontextmenu=function(){return false}; 14</script>