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

14.8.1.1 Closing windows

14.8.1.1 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:

w.close();

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

window.close();

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

欢迎转载,转载请注明来自一手册:http://yishouce.com/book/1/27914.html
友情链接It题库(ittiku.com)| 版权归yishouce.com所有| 友链等可联系 admin#yishouce.com|粤ICP备16001685号-1