[js] 새로고침시 get 파라미터 제거

Sora Kim·2022년 10월 18일
0

JS / jquery

목록 보기
8/12

F5키나 ctrl+r 키를 눌렀을 때, get 파라미터 제거 방법 !

$(document).keydown(function(e){
	key = (e)?e.keyCode:event.keyCode;
	//alert(key);
	if(key == 116 || (event.ctrlKey && event.keyCode == 82)) {
		history.replaceState({}, null, location.pathname);
	}
})

https://java119.tistory.com/m/35

https://ingbeeni.tistory.com/m/entry/jquey-javascript-F5-%EC%83%88%EB%A1%9C%EA%B3%A0%EC%B9%A8-%EB%B2%84%ED%8A%BC-%EB%A7%89%EA%B8%B0

profile
개발잘하고시풔!!!!!!!

0개의 댓글