728x90
1. ๋ถ๋ชจ์ฐฝ(jsp)์์ ์์์ฐฝ ํ์ (jsp)์ผ๋ก ๊ฐ ์ ๋ฌ.
openChild.document.getElementById("sDevice").value();
openChild๋ถํฐ ์์ํ์ฌ ์์์ฐฝ์ ์๋ ํน์ element์ ์ ๊ทผํ ์ ์๋ค.
function sBtnClick(sNum){
var openChild;
var sDevice = $("input[name=sDevice]").val();
openChild.document.getElementById("sDevice").value = sDevice;
}
2. ์์์ฐฝ ํ์ (jsp)์์ ๋ถ๋ชจ์ฐฝ(jsp)์ผ๋ก ๊ฐ ์ ๋ฌ.
์์์ฐฝ์์ ๋ถ๋ชจ์ฐฝ์ ์ ๊ทผํ๊ธฐ ์ํด์๋ opener๋ฅผ ์ฌ์ฉ
opener๋ฅผ ์ด์ฉํ๋ฉด ๋ถ๋ชจ์ฐฝ์ ์๋ ํน์ element์ ์ ๊ทผํ์ฌ ๊ฐ์ ๊ฐ์ ธ์ฌ ์ ์๋ค.
function fn_Insert() {
var resultInput = $("#sDevice").val();
var parent = window.opener;
window.opener.document.getElementById("sDevice").value = resultInput;
self.close();
}
์ฐธ๊ณ : all-record.tistory.com/149
'js' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[AJAX] arrayList null check (0) | 2021.02.21 |
---|---|
[JSTL] fn:contains (0) | 2021.02.18 |
[jQuery] Select Box ํน์ ์ต์ ์ ํ์ show / hide (0) | 2021.02.04 |
[JSTL] JSTL์ด๋? core ์ฃผ์๊ธฐ๋ฅ (1) | 2021.01.15 |
JSP์์ ${pageContext.request} ์ ๋ณด ์ป๊ธฐ (0) | 2021.01.14 |