Window.open篇
这两窗口之间存在着关系.父窗口parent.htm打开子窗口son.htm
子窗口可以通过window.opener指向父窗口.这样可以访问父窗口的对象.
Post.htm
<input type=text name=maintext>
<input type=button value="Open">
Read.htm
<script language="javascript" >
//window.open打开的窗口.
//利用opener指向父窗口.
var parentText = window.opener.document.all.maintext.value;
alert(parentText);
</script>
优点:取值方便.只要window.opener指向父窗口,就可以访问所有对象.
不仅可以访问值,还可以访问父窗口的方法.值长度无限制.
缺点:两窗口要存在着关系.就是利用window.open打开的窗口.不能跨域.
本篇文章来源于 中国建站之家 原文链接:http://www.jz123.cn/Article/10/134/2007/2007121022747.html
本文介绍了如何使用Window.open方法打开新窗口,并通过window.opener属性在新窗口中访问父窗口对象。这种方法适用于需要在两个窗口间传递数据的情况,尤其是在同一域名下操作时更为简便。
2251

被折叠的 条评论
为什么被折叠?



