前边用window.opener=null来完成了窗口的无提示自动关闭.简单查了一下,window.opener是js中window的一个属性,它返回的是打开当前窗口的窗口对象.如果窗口A弹出一个窗口B,那么在B中window.opener就是窗口对象A.
这是JAVASCRIPT参考手册里对于opener的描述
When a source document opens a destination window by calling the open method, the opener property specifies the window of the source document. Evaluate the opener property from the destination window.
This property persists across document unload in the opened window.
You can change the opener property at any time.
You may use Window.open to open a new window and then use Window.open on that window to open another window,and so on. In this way, you can end up with a chain of opened windows, each of which has an opener property pointing to the window that opened it.
Communicator allows a maximum of 100 windows to be around at once.If you open window2 from window1 and then are done with window1, be sure to set the opener property of window2 to null. This allows JavaScript to garbage collect window1. If you do not set the opener property to null, the window1 object remains, even though it's no longer really needed.