可以用window.returnValue=[Value]把test2的值返回

解决方案 »

  1.   

    function getbm(code1,code2){
    returnValue=[code1,code2];
    close();
    }------------------------
    ctrlobj.value = retval[0]
    ctrlobj2.value = retval[1]
      

  2.   

    你可以
    tmpcode:=code1 + '分格符' + code2;
    window.returnValue=tmpcode;
    再在test1.htm页面中取出code1和code2
      

  3.   

    test1.htm:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <script lauguage=javascript>
    function test2V(){
    var col;
    var row
      var adr = showModalDialog("test2.htm", "", "dialogWidth:18.5em; dialogHeight:11.5em; status:0");
      if(adr!=null){
      var ss;
      ss=adr.split(",");
      col=ss[0];
      row=ss[1];
      a.value=col
      b.value=row;
       }}
    </script>
    <input id="a"><input id="b"><input type=button name="button" onclick="test2V()">
    </html>test2.htm
    <html>
    <script>
    function ret(){
    window.returnValue=code1.value+","+code2.value
    }
    </script>
    <input name="code1">
    <input name="code2">
    <input type=button onclick="ret();window.close()">
    </html>