浏览器禁止f5 刷新
document.onkeydown = function (e) {
var event = window.event || e;
var code = event .keyCode || event .which;
if (code == 116) {
event .keyCode ? event .keyCode = 0 : event .which = 0;
cancelBubble = true;
return false;
}
}
禁止右键刷新
document.oncontextmenu=function(){return false};
网友评论