HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
💟
지은팀 Programmers Study
/
🦊
정윤호
/
history api 관련 문법정리

history api 관련 문법정리

참여자
우선순위
상태
Hold
주차
날짜
자바스크립트 라우팅 방법 정리하기
// 라우팅 this.route = () => { const { pathname } = window.location; if (pathname === '/') { postPage.render(); } else if (pathname.indexOf('/posts/') === 0) { const [, , postId] = pathname.split('/'); postEditPage.setState({ postId }); } }; this.route();
 
히스토리, url관련 문법 정리
  • URLSearchParams
  • 뒤로가기, 앞으로가기 처리 (feet. addEventListner - popstate)
 
url 변경
  • history.pushState vs location.href
url 파싱
  • location.search vs URLSearchParams(location.search)
  • 쿼리 가져오기 방법
 
 
document.location.href = './index.html';
 
 
로케이션객체
https://august5pm.tistory.com/8