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

[Window_History] JS - history.go() 메서드 ★ - 특정페이지로 이동 (= history.go메서드 = 히스토리고 메서드)

history.go() 예제

 

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


<script>

function hz() {

  window.history.go(-2);

}

</script>

 

결과보기

※ 바로 이전페이지로 보내기: window.history.go(-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