我现在才明白你的意思,这样改一下
<input type="text" name="top" value="" onkeydown="if(event.keyCode==13){window.top.next.document.all.aaa.value=document.all.top.value;}">
<input type="text" name="top" value="" onkeydown="if(event.keyCode==13){window.top.next.document.all.aaa.value=document.all.top.value;}">
<input type="text" name="top" value="" onkeydown="if(event.keyCode==13){window.top.frames[1].document.all.aaa.value=document.all.top.value;}">注:
上面是假设你的next.html是第二个frame
你的意思是不是在top的input中安下回车,谈出一个页面next.html,然后将top的值赋给next.html页面中aaa文本匡中?
条件是:window.open('next.html?para=var¶2=var2','next');方法二:next.html改用next.asp,取得查询参数。
条件是:window.open('next.asp?para=var¶2=var2','next');方法三:使用window.opener访问前一个window.
<html>
<head>
</head>
<body>
<input type="text" name="top" value="" onkeydown='if(event.keyCode==13) window.open("next.html","next");'>
</body>
</html> <html>
<head>
</head>
<body onload="document.all.aaa.value=window.opener.document.all.top.value;">
<input type="text" name="aaa" value="">
</body>
</html>
//--上面是next.html
<html>
<head>
</head>
<body>
<input type="text" name="top" value="" onkeydown='if(event.keyCode==13) windowopen();'>
<script>
function windowopen(){
var win=window.open("test1.html","next");
win.document.all.aaa.value=document.all.top.value;
}
</script>
</body>
</html> <html>
<head>
</head>
<body>
<input type="text" name="aaa" value="">
</body>
</html>
//--上面是next.html