Javascript pop-up window Summary

Source: Internet
Author: User

1: window. Open
<! --
Optional values open('page.html ', 'newwindow', 'height = 100, width = 400, Top = 0, Left = 0, toolbar = No, menubar = No, scrollbars = No, resizable = No, location = No, status = no ')
// Write a row
-->
Parameter description:
Window. Open command to pop up a new window;
'Page.html 'name of the pop-up window;
'Newwindow' indicates the name of the pop-up window (not the file name). It is optional and can be replaced by null;
Height = 100 window height;
Width = 400 window width;
Top = the pixel value between the 0 window and the top of the screen;
Left = 0 the pixel value between the window and the left of the screen;
Toolbar = No indicates whether to display the toolbar. Yes indicates display;
Menubar and scrollbars indicate the menu bar and scroll bar.
Resizable = No: whether to change the window size. Yes: Yes;
Location = No indicates whether the address bar is displayed. Yes indicates yes;
Status = No whether to display the information in the status bar (usually the file has been opened), yes is allowed;

2: showmodaldialog (), showmodelessdialog ()
(1) window. showmodaldialog () Modal Dialog Box
The modal dialog box always has focus (Focus cannot be removed until it is closed ).

(2) window. showmodelessdialog () Non-Modal Dialog Box
Because it is a dialog box, it does not have all the properties of the window opened with window. open.
You do not need to close it with window. Close,
When [ie5] is opened in non-modal mode, other operations can still be performed in the window that opens the dialog box,
That is, the dialog box is not always the top focus. It is automatically closed when the URL of the window opened changes.

(3) use the following method:
vreturnvalue = Window. showmodaldialog (Surl [, varguments] [, sfeatures])
vreturnvalue = Window. showmodelessdialog (Surl [, varguments] [, sfeatures])
parameter description:
Surl
required parameter; Type: string. Specifies the URL of the document to be displayed in the dialog box.
varguments
optional parameter; Type: variant. Used to pass parameters to the dialog box. The passed parameter types are not limited, including arrays.
in the dialog box, click window. dialogarguments to obtain the passed parameters, and use window. returnvalue to return parameters.

sfeatures
optional parameter, type: string. Used to describe the appearance and other information of the dialog box. You can use one or more of the following, separated by semicolons.
the dialogheight dialog box is not smaller than PX. The default unit of dialogheight and dialogwidth in ie4 is em, while that in ie5 is PX, when defining the modal mode dialog box, PX is used as the unit.
dialogwidth: Dialog Box width.
dialogleft: The left distance from the desktop.
dialogtop: the distance from the desktop.
center: {Yes | no | 1 | 0}: whether the window is centered. The default value is yes, but the height and width can still be specified.
help: {Yes | no | 1 | 0}: whether to display the Help button. The default value is yes.
resizable: {Yes | no | 1 | 0} [ie5 +]: whether the size can be changed. No by default.
Status: {Yes | no | 1 | 0} [ie5 +]: whether to display the status bar. The default value is Yes [modeless] or no [modal].
scroll: {Yes | no | 1 | 0 | on | off}: Specifies whether the scroll bar is displayed in the dialog box. The default value is yes.

There are also several attributes used in HTA, which are generally not used in general web pages.
Dialoghide: {Yes | no | 1 | 0 | on | off}: whether the dialog box is hidden when printing or previewing. The default value is no.
Edge: {sunken | raised}: Specifies the border style of the dialog box. The default value is raised.
Unadorned: {Yes | no | 1 | 0 | on | off}: No by default.

3. Parent Window refresh
(1) window opened with window. open ()
 Window. opener. Location. Reload ();
 
(2) window opened with showmodaldialog ()
Using response parent.dialogarguments.document.exe ccommand ('refresh ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.