본문 바로가기

WebStudy

창 열기, 부모창으로 값 전달, 자식창 닫기

window.open("findAddr.jsp", "주소찾기", "width=500 height=350 menubar=no scrollbars=yes resizeable=yes");

 

$(opener.document).find("#fstZip").val(value);

 

 

window.self.close();

 

window 는 보고있는 창.

 

self는 자기 창.

 

parent 등등 다양한 접근자?? 가 있음.

 

또는

javascript----------------------

 

function zip(zipcode, zipaddr){
 var zipArr = zipcode.split("-");
 opener.frm.zip1.value = zipArr[0];
 opener.frm.zip2.value = zipArr[1];
 opener.frm.addr1.value = zipaddr;
 
 self.close();
}

'WebStudy' 카테고리의 다른 글

비동기 통신 JSON  (0) 2015.06.22
비동기 통신, AJAX - javascript  (0) 2015.06.22
테이블 클릭시 값 가져오기  (0) 2015.06.22
config  (0) 2015.06.18
jsp 수업정리 - 08  (0) 2015.06.18