Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 네트워크
- IntelliJ
- Windows 10
- web.xml
- port
- lsof
- DB 도메인
- Windows
- grep
- xargs
- context
- ssh
- 공통표준용어
- find
- tomcat
- profile
- maVen
- copy-dependencies
- import
- resource
- JavaScript
- Eclipse
- Quartz
- GIT
- 단축키
- bash
- Mac
- Source
- netsh
- VirtualBox
Archives
- Today
- Total
develog
[javascript] 팝업창에서 부모창으로 post 방식으로 전달하기 본문
팝업창 코드
- form 의 target 을 opener.window.name 로 설정
function doPost(url, param, target) {
var form = document.createElement('form');
for (var key in param){
var value = param[key];
var obj = document.createElement('input');
obj.setAttribute('type', 'hidden');
obj.setAttribute('name', key);
obj.setAttribute('value', value);
form.appendChild(obj);
}
if (target) {
form.setAttribute('target', target);
form.setAttribute('method', 'post');
form.setAttribute('action', url);
document.body.appendChild(form);
form.submit();
}
}
doPost('/notice/noticeRead.jsp', {'currentPage' : '1', 'seq' : 345}, 'opener.window.name');
Comments