window.opener.form1.inputnam.value=
还是不行啊

解决方案 »

  1.   

    window.opener.document.form1.inputnam.value=
    你可能没有权限操作其它服务器的内容
      

  2.   

    用模态框,直接设置window.returnValue试试?
      

  3.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta http-equiv="pragma" content="no-cache" />
    <style type="text/css">
    <!--
    -->
    </style>
    <script language="JavaScript">
    <!--
    function ShowDialog(){
    var ret=window.showModalDialog('http://localhost:123/test.html','','center:yes;help:no;dialogWidth:200px;dialogHeight:100px;')
    if(ret){
    ret1.value=ret[0];
    ret2.value=ret[1];
    ret3.value=ret[2];
    }
    }
    -->
    </script>
    <title></title>
    </head>
    <body>
    返回值1:<input type="text" name="ret1" /><br />
    返回值2:<input type="text" name="ret2" /><br />
    返回值3:<input type="text" name="ret3" /><br />
    <button onclick="JavaScript:ShowDialog();">测试跨域传值</button>
    </body>
    </html>
      

  4.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta http-equiv="pragma" content="no-cache" />
    <link rel="stylesheet" type="text/css" href="/style/default.css" />
    <style type="text/css">
    <!--
    -->
    </style>
    <script language="JavaScript" src="/Script/Default.js"></script>
    <script language="JavaScript">
    <!--
    window.returnValue=null;
    function ReturnValue(){
    var ret=new Array('测试','test','123456');
    window.returnValue=ret;
    window.close();
    }
    -->
    </script>
    <title></title>
    </head>
    <body><br />
    <center><input type="button" onclick="JavaScript:ReturnValue();" value="返回三个值" /></center>
    </body>
    </html>
      

  5.   

    to  eglic(圪圪)
    我试一下:
    var ret=window.showModalDialog('http://localhost:123/test.html','','center:yes;help:no;dialogWidth:200px;dialogHeight:100px;')
     ret得不值啊
      

  6.   

    to  eglic(圪圪)
    我试一下:
    var ret=window.showModalDialog('http://localhost:123/test.html','','center:yes;help:no;dialogWidth:200px;dialogHeight:100px;')
     ret得不到值啊
    但window.returnValue他有值