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">