일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 자바스크립트
- 에러
- 반복문
- 파이썬
- 출력
- Android Studio
- 안드로이드 스튜디오
- spring boot
- 코드업
- 2차원 리스트
- 시작
- 설정
- 예제
- 27G2
- JavaScript
- 버튼 이벤트
- 변경
- 방법
- 리팩터링
- 설치
- 점심
- 안드로이드
- java
- r
- 자바
- CodeUP
- 안스
- 맛집
- python
- JDK 8
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, '#');
};
반응형