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 |
Tags
- import
- IntelliJ
- Quartz
- Windows 10
- 줄바꿈 문자
- find
- xargs
- lsof
- Source
- port
- web.xml
- plugin
- Eclipse
- JavaScript
- ssh
- resource
- netsh
- tomcat
- context
- grep
- profile
- 단축키
- vscode
- 네트워크
- GIT
- Mac
- maVen
- VirtualBox
- bash
- Windows
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