//부모창의 필드값 갖고 오기
1. 일반적인 방법 var parentValue = opener.document.getElementById("parentId").value;
2. jQuery를 이용한 방법 $("#parentId", opener.document).val();
3. find를 이용한 방법 $(opener.document).find("#parentId").val(); |
//동적으로 생성한 폼을 부모창에 붙이기
1. jQuery를 이용한 방법 $(opener.document).find("#parentId").append(html); |
//팝업창에서 부모창 함수 호출
1-1. 일반적인 방법 opener.location.href = "javascript:부모스크립트 함수명();";
1-2. 일반적인 방법 window.opener.fnCall();
2. jQuery를 이용한 방법 $(opener.location).attr("href", "javascript:부모스크립트 함수명();"); |
//팝업창에서 부모창으로 값 넘기기
1-1. 일반적인 방법 window.opener.document.getElementById("parentId").value = "부모창으로 전달할 값";
1-2. 일반적인 방법 window.opener.폼네임.parentInputName.value = value;
2. jQuery를 이용한 방법 $("#parentId", opener.document).val(부모창으로 전달할 값);
3. find를 이용한 방법 $(opener.document).find("#parentId").val(부모창으로 전달할 값); |
//부모창의 CSS 변경
1. jQuery를 이용한 방법 $("#parentId", opener.document).css("display", "none"); |
//팝업창 닫기
window.self.close(); |
//팝업창 자신 페이지 새로고침
document.location.reload(); |
//팝업창에서 부모창 새로고침(새로고침 의사 표현을 묻는 창이 뜸)
window.opener.parent.location.reload(); window.opener.document.location.reload();
|
[출처] 【jQuery】팝업창 opener|작성자 너와나