window.opener是指调用window.open方法的窗口,如在A窗口中打开B窗口,在B窗口中操作完以后关闭B窗口,同时自动刷新A窗口。
例:
demo.htm
<input type="text" name="txt" value="baobao">
<input type="button" οnclick="window.open('in.htm')" value="Open">
in.htm
<input type="button" οnclick="alert(window.opener.document.all.txt.value)"
value="Get">
例:
demo.htm
<input type="text" name="txt" value="baobao">
<input type="button" οnclick="window.open('in.htm')" value="Open">
in.htm
<input type="button" οnclick="alert(window.opener.document.all.txt.value)"
value="Get">