window.opener
window.opener并非JS新特性,但有时却被忽视了,这里总结下它的价值
window.opener作用
The Window interface’s
**opener**
property returns a reference to the window that opened the window, either with open(), or by navigating a link with atarget
attribute.
即opener赋予了操作另一个文档的能力,当然不是每一个页面都可以。
这种能力还是有用武之地的,举个例子,A页面点击连接打开了B页面,我现在希望B在点击某个按钮时,A刷新,如何实现呢,opener也许就可以。