//1. split() method를 사용한 location 방법
window.location = window.location.href.split("?")[0];

//2. pathname 을사용한 location 방법
window.location = window.location.pathname;

위의 코드는 같은 동작을 하며, GET 파마리터 를 제거한 현재의 URL주소로 페이지를 새로고침하게된다.

 

 

//(event.keyCode == 78 || event.keyCode == 82) : ctrl+N , ctrl+R
//(event.keyCode == 116) : f5
//F5, 새로고침 , Ctrl + R, Ctrl + N ==> 키보드 이벤트 적용
if((event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) || (event.keyCode == 116))
{
	myscript();
}

이런식으로 버튼식 초기화로 구현하던가, 새로고침 버튼 key값을 이용하여 새로고침시 자동으로 적용되도록 하면 될것같다.

+ Recent posts