참고 : html 메타테그
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
mypage.html 에서 뒤로가기를 막으려면,
<body onunLoad="window.location.replace('mypage.html')">
뒤로가기금지시키기
<html>
<head>
<title>제목없음</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
ok_urls = new Array();
ok_urls[1] = "http://suldo.zotta.net";
ok_urls[2] = "http://suldo.net";
// 프레임 셋 문서를 호출하는 모든 주소를 삽입합니다.
function reportError(msg, url, LINE) {
if (url == window.location.href) {
msg = "\n죄송합니다\n\n" +
"이 사이트는 뒤로가기가 잠겨 있습니다\n";
alert(msg);
top.location.href = ok_urls[1] + "?" + window.location.href;
return true;
}
}
window.onerror = reportError;
url_found = 0;
for (var i = 1; i <= ok_urls.length && !url_found; i++) {
url_found = (parent.location.href.indexOf(ok_urls[i]) == -1);
}
if (!url_found || (window == top))
top.location.href = ok_urls[1] + "?" + window.location.href;
// End -->
</script>
</head>
<body>
</body>
</html>
이글루스 가든 - 프로그래머 최고수가 되는 길
덧글