Home  >  Article  >  Web Front-end  >  禁止页面刷新让F5快捷键及右键都无效_javascript技巧

禁止页面刷新让F5快捷键及右键都无效_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:03:031271browse
复制代码 代码如下:

/*禁止页面刷新*/
document.onkeydown = function()
{
if(event.keyCode==116) {
event.keyCode=0;
event.returnValue = false;
}
}
document.oncontextmenu = function() {event.returnValue = false;}
/* 结束*/
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn