The window object is the top-level object in the JavaScript browser object model. It contains multiple common methods and attributes. The following describes how to use the window object as the top-level object in the JavaScript browser object model, contains multiple common methods and attributes:
1. open a new window
The Code is as follows:
Window. open (pageURL, name, parameters)
Where:
PageURL is the sub-window path
Name is the sub-window handle
Parameters is window parameters (parameters are separated by commas)
For example:
The Code is as follows:
Window. open ("http://www.cnblogs.com/zhouhb/", "open", 'height = 100, width = 400, top = 0, left = 0, toolbar = no, menubar = no, scrollbars = no, resizable = no, location = no, status = no ');
2. Open the mode window.
The Code is as follows:
Window. showModalDialog ("http://www.cnblogs.com/zhouhb/", "open", "toolbars = 0; width = 200; height = 200 ");
3. Close the window. No prompt box is displayed.
If the webpage is not opened through a script program (window. open (), call window. before closing the window, you must close the window. the opener object is set to null. Otherwise, the browser (IE7 and IE8) will pop up a confirmation and close dialog box.
The Code is as follows: