parent.hmtl
코드 사본은 다음과 같습니다.
<! doctype html public "-// w3c // dtd html 4.01 Transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<헤드>
<meta http-equiv = "content-type"content = "text/html; charset = utf-8">
<title> 부모 창 </title>
<script type = "text/javaScript">
Window.onload = function () {
var btn = document.getElementById ( "btn");
btn.onclick = function () {
var obj = {
테스트 : "Zhang San이 어린이 창으로지나갑니다",
WIN : 창
};
var returnValue = wind
if (returnValue! = null) {
document.getElementById ( "content"). innerHtml = returnValue;
}
};
}
</스크립트>
</head>
<body>
<div id = "content"style = "마진 : 50px; 너비 : 100px; 높이 : 150px; 테두리 : 5px solid #0000ff;"> </div>
<입력 유형 = "버튼"id = "btn"value = "Popup subwindow">
</body>
</html>
child.html
코드 사본은 다음과 같습니다.
<! doctype html public "-// w3c // dtd html 4.01 Transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<헤드>
<meta http-equiv = "content-type"content = "text/html; charset = utf-8">
<title> 서브 윈도우 </title>
<script type = "text/javaScript">
Window.onload = function () {
// URL 패스 매개 변수를 가져옵니다
var args = window.dialogarguments;
var win = args.win; // presenting window 객체
var content = document.getElementById ( "content");
content.value = args.test;
var btn = document.getElementById ( "btn");
btn.onclick = function () {
// MODAL 대화 상자에는 값이 있습니다
window.returnValue = content.value;
Window.Close ();
}
}
</스크립트>
</head>
<body>
<입력 유형 = "text"id = "content"> <input type = "button"id = "btn"value = "부모 창으로의 전달 값">
</body>
</html