Posted in Javascript onNovember 25, 2006
<script language="JavaScript">
//禁止刷新,回退
function onKeyDown()
{
if ( (event.altKey) || ((event.keyCode == 8) &&
(event.srcElement.type != "text" &&
event.srcElement.type != "textarea" &&
event.srcElement.type != "password")) ||
((event.ctrlKey) && ((event.keyCode == 78) || (event.keyCode == 82)) ) ||
(event.keyCode == 116) ) {
event.keyCode = 0;
event.returnValue = false;
}
}
document.onkeydown = onKeyDown;
function stop(){ //这个是禁用鼠标右键
return false;
}
document.oncontextmenu=stop;
</script>
禁止刷新,回退的JS
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@