javascript
禁止网页刷新JS
js:
<script language="Javascript">?
//禁止右鍵彈出菜單?
function ? document.oncontextmenu() { ? ? ??
? ? ? return ? false; ? ? ??
}
function window.onhelp(){return false} //屏蔽F1幫助
function document.onkeydown() { ?
? ? if ((window.event.altKey)&& ? ??
? ? ((window.event.keyCode==37)|| //屏蔽 Alt+ 方向鍵 ← ? ??
? ? (window.event.keyCode==39))) ?//屏蔽 Alt+ 方向鍵 → ? ??
? ? { ? ??
? ? ? ?alert("不準(zhǔn)你使用ALT+方向鍵前進(jìn)或后退網(wǎng)頁(yè)!"); ? ??
? ? ? ?event.returnValue=false; ? ??
? ? } ? ??
? ? /* 注:這還不是真正地屏蔽 Alt+ 方向鍵, ? ?
? ? 因?yàn)?Alt+ 方向鍵彈出警告框時(shí),按住 Alt 鍵不放, ? ?
? ? 用鼠標(biāo)點(diǎn)掉警告框,這種屏蔽方法就失效了。以后若 ? ?
? ? 有哪位高手有真正屏蔽 Alt 鍵的方法,請(qǐng)告知。*/ ? ??
? ? if ((event.keyCode==8) || //屏蔽退格刪除鍵 ? ??
? ? (event.keyCode==116)|| ? ? //屏蔽 F5 刷新鍵 ? ??
? ? (event.ctrlKey && event.keyCode==82)){ //Ctrl + R ? ??
? ? ? ?event.keyCode=0; ? ??
? ? ? ?event.returnValue=false; ? ??
? ? } ? ??
? ? if (event.keyCode==122){event.keyCode=0;event.returnValue=false;} //屏蔽F11 ? ??
? ? if (event.ctrlKey && event.keyCode==78) event.returnValue=false; ?
//屏蔽 Ctrl+n ? ??
? ? if (event.shiftKey && event.keyCode==121)event.returnValue=false;?
//屏蔽 shift+F10 ? ??
? ? if (window.event.srcElement.tagName == "A" && window.event.shiftKey) ? ??
? ? ? ?window.event.returnValue = false; //屏蔽 shift 加鼠標(biāo)左鍵新開(kāi)一網(wǎng)頁(yè) ? ??
? ? ? ?if ((window.event.altKey)&&(window.event.keyCode==115)) ? ? ? //屏蔽Alt+F4 ? ??
? ? ? ?{ ? ??
? ? window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px"); ? ??
? ? ? ?return false; ? ??
? ? } ? ??
}
//下面代碼實(shí)現(xiàn)全屏顯示 ? ? ??
function ? window.onload(){ ? ? ??
? ? var Request = new Array();//保存參數(shù) ? ? ??
? ? 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"; ? ? ??
? ? } ? ? ??
}
</script>
總結(jié)
- 上一篇: tomcat7+nginx+memcac
- 下一篇: myeclipse集成jad