something like:
<script language="JavaScript">
opener.document.getElementById('name').value=document.getElementById('name1');
window.open('','_top');
window.top.close();
</script>
<script language="JavaScript">
opener.document.getElementById('name').value=document.getElementById('name1');
window.open('','_top');
window.top.close();
</script>
再一个就是使用摸态窗体可以传递参数,也能获得操作的数据.Window.ShowModalDialog 你可以搜索一下,不过只对IE有效,火狐不支持.
如果他们没有这样的关系就好象没办法在两个页面间进行操作!
看下我的4楼回复。。参数传递
然后2.html得到cookie中数值定时刷新页面就可以
就是比较耗资源
#calc{width:200px;height:200px;border:#ccc 1px solid;background:#efefef;position:absolute;}
</style>
<script>
var $=document.getElementById;
var controller = {
resultInput:"",
calculator:"",
showInput:function(resultInput,calculator){
if(calculator.style.display == "block") return;
this.resultInput = resultInput;
this.calculator = calculator;
calculator.style.display = "block";
},
applyResult:function(result){
this.resultInput.value = result;
this.calculator.style.display = "none";
}
}
</script>
<input type="text" id="txtNum" name="txtNum" readonly="true" onfocus="controller.showInput(this,$('calc'))" />
<div id="calc" style="display:none;">
<div class="inputNum"><input type="text" id="txtInput" name="txtInput"/></div>
<div><a href="javascript:void(0)" onclick="controller.applyResult($('txtInput').value)">确认</a></div>
</div>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<input type="checkBox" id="name1" name="name" value="num1" onclick="pass(this)" >num1 <br>
<input type="checkBox" id="name2" name="name" value="num2" onclick="pass(this)" >num2 <br>
<input type="checkBox" id="name3" name="name" value="num3" onclick="pass(this)" >num3 <br>
<input type="checkBox" id="name4" name="name" value="num4" onclick="pass(this)" >num4 <br>
<input type="checkBox" id="name5" name="name" value="num5" onclick="pass(this)" >num5 <br> </body>
</html>
<script>
function pass(o)
{
window.location.href='b.html?id=' + o.value
}
</script>
b.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>无标题文档</title>
</head><body>
<script>
var str = window.location.search
if(str!="")
{
str = str.split("?")[1]
str = str.split(escape("&"))
for(var i= 0;i<str.length;i++)
{
document.write("a页面的值:"+str[i].split("=")[1])
}
}
</script>
</body>
</html>