주소창 변조하기
Syntax
pushState(state, unused)
pushState(state, unused, url)
Parameters
- state: 상태값. 브라우저에서 앞/뒤로 갈 때 넘겨줄 데이터
- unused: 원래는 title(변경할 브라우저 제목)을 넣었다고 한다. 더 이상 사용되지 않고 생략이 불가하다고 한다.
- url: 변경할 브라우저 URL
Return Value
None
Example Code
history.pushState(null, null, 'abracadabra') // hostname은 변경할 수 없지만 pathname은 변경할 수 있다