window.opener是指调用window.open方法的窗口,如在A窗口中打开B窗口,在B窗口中操作完以后关闭B窗口,同时自动刷新A窗口。
例:
demo.htm
<input type="text" name="txt" value="baobao">
<input type="button" onclick="window.open('in.htm')" value="Open">
in.htm
<input type="button" onclick="alert(window.opener.document.all.txt.value)"
value="Get">
例:
demo.htm
<input type="text" name="txt" value="baobao">
<input type="button" onclick="window.open('in.htm')" value="Open">
in.htm
<input type="button" onclick="alert(window.opener.document.all.txt.value)"
value="Get">
本文介绍window.opener的概念及使用方法,演示了如何在A窗口打开B窗口后,通过B窗口获取A窗口的数据,并实现关闭B窗口时自动刷新A窗口的功能。
377

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



