当前位置: 编程技术>jquery
js禁止页面刷新 js禁止用F5键刷新 js禁止右键
来源: 互联网 发布时间:2014-09-03
本文导语: 代码1: //禁止用F5键 function document.onkeydown() { if ( event.keyCode==116) { event.keyCode = 0; event.cancelBubble = true; return false; } } //禁止右键弹出菜单 function document.oncontextmenu() { return false; } //全屏显示 function window.o...
代码1:
//禁止用F5键 function document.onkeydown() { if ( event.keyCode==116) { event.keyCode = 0; event.cancelBubble = true; return false; } } //禁止右键弹出菜单 function document.oncontextmenu() { return false; } //全屏显示 function window.onload(){ var Request = new Array();//保存参数 var s = location.search.substring(1); if (s && s!=""){ var list = s.split("&"); for (var i=0; i < list.length; i++){ var pair = list[i].split("="); if (pair[0] && pair[0] !=""){ Request[unescape(pair[0])] = unescape(pair[1]); } } } var fullscreen=Request["fullscreen"]; if(fullscreen!="yes"){ var file =self.location; var a = window.open("about:blank","","fullscreen=yes") self.opener=null self.close() a.location=file + "?fullscreen=yes"; } }
代码2: