在第一个网页里这样定义
var myparm;
function setmyparm(v){
myparm=v;
alert(myparm);
}然后在第二个网页里写
<html>   
<head>
<script language="javascript">   
function closewithreturn(v){
window.opener.setmyparm(v);
closeme();
}
  function closeme(){
    window.opener=null;   
    window.close();   
  }
</script>   
</head>   
<body>   
请输入新号码
<br>
<input type="text" name="txtNumber">
<br>
<input type="submit" name="Submit2" value="确定" onclick="closewithreturn(document.all.txtNumber.value)">
<input type="submit" name="Submit" value="取消" onclick="closeme()">
</body>   
</html>

解决方案 »

  1.   

    showModalDialog可以有一个返回值的
    在模态窗口里设置window.returnValue="1";
    原窗口可以得到该值
      

  2.   

    上面两位说的都不错,我补充下2楼的:
    在第二个网页里写:function closeOk(){
    window.returnValue = document.all["txtNumber"].value;
    window.close();
    }
    这样在第一个窗口就能得到这个值了,这样写:
    var retVal = window.showModalDialog("callee.htm","打开了一个新模态窗口");
    retVal 就是你在第二个页面输入的值