• 회원가입
  • 로그인
  • 구글아이디로 로그인

[Window_History] JS - history.back() 메서드 ★ - 이전페이지 가기

history.back() 예제

 

<button onclick="hz()">이전페이지 가기</button>


<script>

function hz() {

  window.history.back();

}

</script>

 

결과보기

※ 현재창 기준으로 이전페이지 없는 경우, 이동 안 됨.

※ history.back(1); // 바로 앞 페이지로 이동

 


분류 제목
Window_History JS - window.history 객체 정의 + 히스토리 객체의 (속성/메서드) 종류
Window_History JS - history.length 속성 - history개수 (= 방문이력개수 = 방문주소개수 = 히스토리…
Window_History JS - history.back() 메서드 ★ - 이전페이지 가기
Window_History JS - history.forward() 메서드 - 다음페이지 가기
Window_History JS - history.go() 메서드 ★ - 특정페이지로 이동 (= history.go메서드 = 히스토리고…
목록
찾아주셔서 감사합니다. Since 2012