用window.showModalDialog() 实现
test1.htm
===================
<script>
var a = window.showModalDialog("test2.htm")
for(i=0;i<a.length;i++) alert(a[i])
</script>
test2.htm
===================
<script>
function sendTo()
{
var a=new Array("a","b")
window.returnValue = a
window.close()
}
</script>
<body>
<form>
<input value="返回" type=button onclick="sendTo()">
</form>
用window.open() 实现
test1.htm
==========
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<script>
var a ='';
window.open("test2.htm");
function button1_onclick() {
alert(a);
}
</SCRIPT>
</HEAD>
<BODY><INPUT id=button1 type=button value=Button name=button1 LANGUAGE=javascript onclick="return button1_onclick()"></BODY></HTML>
test2.htm
======================
<script>
function sendTo()
{
window.opener.a='test';
}
</script>
<body>
<form id=form1 name=form1>
<input value="返回" type=button onclick="sendTo()" id=button1 name=button1>
</form>