上有打错 是button  不是 burron  在my.jsp 有一个button 上 onclick()事件上调用如下的代码

解决方案 »

  1.   

    window.parent.opener.myform.result.value="滴吧贱B"myform 是父窗体的form名称  result是父窗体form中的一个元素
      

  2.   

    我以前写过几个页面间传值的小例子,找给比较简单的给你吧,把代码直接粘出来就ok了:
    ---------------------------------
    这是父页面:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>AA</title>
    </head>
    <body>
    <form name="form">
    向子页面传的值:
    <input type="text" name="aa" /><input type="button" value="submit" onclick="window.open('b.html','_blank','height=200,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');" />
    </form>
    </body>
    </html>
    ---------------------------------
    这是弹出页面:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>BB</title>
    <script language="javascript"><!--
    function fuzhi(){
    var a = document.ad.str1.value;
    var b = document.ad.str2.value; var c = a + b; window.opener.form.aa.value = c;
    window.close();
    }
    // -->
    </script>
    </head><body>
    <form name="ad">
    <table width="300" height="150" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#FF0000">
      <tr>
    <td bgcolor=white>父窗口传来的值是:
    <!-- ----------------------------- --> 
    <script language="javascript">
    var aaa=window.opener.form.aa.value;
    document.write(aaa);
    </script> 
    <!-- ----------------------------- --> 
    </td>
      </tr>
      <tr>
        <td align="center" valign="middle" bgcolor="#FFFFFF">
    <input type="button" value="给母窗口赋值" onclick="fuzhi()"  />
    </td>
      </tr>
      <td bgcolor=white>
    回传的第一个字符串:<br><input type="text" name="str1" /><br>回传的第二个字符串:<br><input type="text" name="str2" />
      </td>
    </table>
    </form>
    </body>
    </html>