index.html代码:<frameset id="frameset" rows="29,*,20" cols="*" frameborder="no" scrolling="no">
<frame name="Thetop" src="sub1.html" scrolling="no" noresize />
<frame name="Themain" src="sub2.html" scrolling="no" noresize />
</frameset>
sub1.html
<table>
<tr>
<td>姓名:</td><td><input type="text" name="userName"/></td>
<td>个人编号:</td><td><input type="text" name="grbh"/></td>
</tr>
</table>
sub2.html
<hr>
李主任
0015431666
<input type="button" name="test" value="test" onclick="test('李主任','0015431666')"/>
<script language="javascript">
function test(uname,grbh)
{
parent.frames["Thetop"].document.all.userName.value=uname;
parent.frames["Thetop"].document.all.grbh.value=grbh;
}
</script>