JavaScript: The Definitive Guide, Sixth Editio javaScript权威指南(第6版) pdf 文字版-文字版, javascript电子书, 和javascript 有关的电子书: Closing windows Closing windows

Just as the open() method opens a new window, the close() method closes one. If you create a Window object w, you can close it with:


JavaScript code running within that window itself can close it with:


Note the explicit use of the window identifier to distinguish the close() method of the Window object from the close() method of the Document object—this is important if you’re calling close() from an event handler.

Most browsers allow you to automatically close only those windows that your own JavaScript code has created. If you attempt to close any other window, the request either fails or the user is presented with a dialog box that asks him to allow (or cancel) that request to close the window. The close() method of a Window object that represents a frame rather than a top-level window or tab does nothing: it is not possible to close a frame (instead you’d delete the

友情链接It题库(| 版权归yishouce.com所有| 友链等可联系|粤ICP备16001685号-1