javascript(jquery)

[javascript/jquery] 변경된 url로 페이지 리로드

콩배 2024. 2. 1. 17:57
<script>
var currentUrl = opener.location.href;
// URL 객체 생성		
var url = new URL(currentUrl);		
 // 특정 쿼리 매개변수 삭제
url.searchParams.delete('idx');
// 변경된 URL로 페이지 리로드
opener.location.href = url.toString() + "&idx=<%=Idx)%>";		
window.close();
</script>