일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 파이썬
- 자바스크립트
- 에러
- 점심
- 2차원 리스트
- 방법
- 맛집
- 리팩터링
- 안드로이드 스튜디오
- CodeUP
- 버튼 이벤트
- 자바
- JavaScript
- 안스
- 반복문
- 27G2
- 안드로이드
- 시작
- 출력
- 변경
- python
- JDK 8
- spring boot
- 코드업
- r
- 설치
- Android Studio
- java
- 설정
- 예제
Archives
- Today
- Total
기루 기룩 기록
뒤로가기 방지 본문
반응형
보안상 사용자와 client의 상호작용이 없으면 적용되지 않음
function noBack() {
history.pushState('preventLocation', document.title, '#');
if (typeof window.addEventListener != 'undefined') {
window.addEventListener('popstate', clearHistory);
} else if (typeof window.attachEvent != 'undefined') {
window.attachEvent('popstate', clearHistory);
} else {
window.onpopstate = clearHistory;
}
};
function clearHistory() {
history.pushState('popstateFunction', document.title, '#');
};
반응형