转自 :http://blog.csdn.net/yemy/archive/2006/10/25/1351413.aspx
父页面
<html>
<head>
<title>无标题页</title>
<script language="javas
function opendialog1()
{
var someValue=window.showModalDialog("b.html","","dialogWidth=500px;dialogHeight=500px;status=no;help=no;scrollbars=no");
document.form1.p1t.value=someValue;
}
</script>
</head>
<body>
<form name="form1" act
<input type="text" name="p1t">
<input type="button"
value="打开对话框" on
</form>
</body>
</html>
子页面
<html>
<head>
<title>无标题页</title>
<script language="javas
function a(wname)
{
parent.window.returnValue=wname; //父窗口就是上一个页面
window.close();
}
</script>
</head>
<body>
<form name="form1" act
<input type="button"
value="传值" on
</form>
</body>
</html>