728x90
팝업창 닫을 때, 현재 페이지 새로고침을 하기위해, onbeforeunload 이벤트를 사용했다.
onveforeunload 이벤트란,
사용자의 페이지에서 벗어날 때, 즉 뒤로가기나 팝업창을 닫을 때 일어나는 이벤트인 것 같다.
function create_baby_profile() {
var popup = window.open('/profile/create', '네이버팝업', 'width=700px,height=700px,scrollbars=yes');
popup.onbeforeunload=function (){
window.location.reload();
}
}
*참고
https://jaimemin.tistory.com/1539
https://doolyit.tistory.com/205
반응형
'JavaScript > 문법' 카테고리의 다른 글
[Rejex] 정규 표현식 ( 정규식 - Regular expression) (0) | 2021.10.19 |
---|---|
[JS] javascript(자바스크립트) - 배열 내부 원소 값(문자열) 체크하기 [every(), some() ] (0) | 2021.10.19 |
[jquery] toggleCalss - html 클래스 값 제어 (0) | 2021.10.08 |
[javascript & jquery] attr() 사용법 (0) | 2021.09.28 |
템플릿 리터럴 (0) | 2021.09.21 |