brunch

You can make anything
by writing

C.S.Lewis

by Daniel Lim Mar 09. 2017

주소창의 parameter  제거

JAVASCRIPT TIP

보통은 주소창에 parameter 값이 다음과 같이 표출된다.

https://lahuman.github.io/posts/?lang=ko

이때 해당 주소에서 parameter 값만 제거하고 싶을 경우 다음의 스크립트를 이용하면 간단히 처리할 수 있다.

history.replaceState({}, null, location.pathname);

parameter가 제거된 값은 다음과 같다.

https://lahuman.github.io/posts/

작가의 이전글 Redis 설치 및 Cluster 구성

작품 선택

키워드 선택 0 / 3 0

댓글여부

afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari