/* function noBack(){window.history.forward()} noBack(); window.onload=noBack; window.onpageshow=function(evt){if(evt.persisted)noBack()} window.onunload=function(){void(0)} */ // 뒤로 가기 등의 키 방지용 document.onkeydown = function (e) { var evt = e || window.event; key = (e) ? e.keyCode : event.keyCode; if (key == 8 || key == 116 || key == 13) { //alert(event.srcElement.type); if (e) { //표준 var obj=e.target; if (obj.tagName.toUpperCase() != "INPUT" && obj.tagName.toUpperCase() != "TEXTAREA" && obj.tagName.toUpperCase() != "PASSWORD" && obj.tagName.toUpperCase() != "A") { e.preventDefault(); } }else { if (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password" && event.srcElement.type != "a") { event.keyCode = 0; event.returnValue = false; } } } // F5 방지(새로고침) if (evt.keyCode == 116) { evt.keyCode= 2; return false; } else if(evt.ctrlKey && (evt.keyCode==78 || evt.keyCode == 82)) { return false; } } // 마우스 오른쪽 클릭으로 새로고침하는 것을 방지 document.oncontextmenu = function (e) {return false; } // 뒤로 가기 버튼 시 데이터 손실 방지용 function noBack() { window.history.forward() } noBack(); window.onload = noBack; window.onpageshow = function (evt) { if (evt.persisted) noBack() } window.onunload = function () { void (0) } history.pushState(null, null, location.href); window.onpopstate = function () { history.go(1); };