var childWin =window.open("")
childWin.location="http://lucky.myrice.com"
zai child里:
window.opener.document.fname.input1.value="haha"
childWin.location="http://lucky.myrice.com"
zai child里:
window.opener.document.fname.input1.value="haha"
调试欢乐多
父窗口:
<html>
<head>
<script language="JavaScript">
var childWin;
function aa(){
childWin=window.open("b.html");
childwin.document.form2.input.value="dfdsf";
}
function ab(){
childwin.document.form2.input.value="dfdsf";
childwin.document.form2.write.value="写入";
}</script><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0">
<tr><form name="form1" method="post" action="">
<td width="60%">
<input type="button" name="open" value="弹出" onclick="aa()">
</td>
<td width="40%">
<input type="button" value="输入" name="write" onclick="ab()">
<input type="text" name="textfield" value="">
</td></form>
</tr>
</table>
</body>
</html>
子窗口:
<html>
<head>
<script language="JavaScript">
function aa(){
window.opener.document.form1.open.value="open";
window.opener.document.form1.write.value="write";
window.opener.document.form1.textfield.value="输入";
}
</script>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0">
<tr><form name="form2" method="post" action="">
<td>
<input type="button" value="输入" name="write" onclick="aa()">
</td>
<td> <input type="text" name="input" value=""></td>
</form></tr>
</table>
</body>
</html>