Window. showmodaldialog dialog box refreshing

Source: Internet
Author: User

"> Window. showmodaldialog pop-up dialog box refresh the summary of the problem

Posted on Yang Rui --> reading (31) Comments (0) EDIT favorite window. showmodaldialog refresh parent window and current window methods and note:

I. Method to refresh the parent window:
A. Use window. returnvalue to pass a value to the parent window, and then judge whether to refresh the Window Based on the value.

On the window. showmodaldialog window page, use window. returnvalue to set the return value;
For example, window. returnvalue = 'refresh ';

B. When writing window. showmodaldialog window function, define a variable and operate the parent window according to the variable value;
For example, VAR winpar = Window. showmodaldialog (URLs, 'erpwindows', 'dialogwidth = '+ widths + 'px; dialogheight =' + heigths + 'px; status = no; center = yes; scroll = no ');
If (winpar = "refresh ")
Window. Location. Reload (); // executed when the window. showmodaldialog window is closed
The return value set by winpar for step a in the showmodaldialog window

Conclusion: The Window. showmodaldialog function opens an IE mode window (that is, the parent window cannot be operated after the window is opened, and the operation can only be performed when the mode window is closed ),

Therefore, to refresh the parent window, you can only execute it after the mode window is closed. Window. returnvalue can be used to pass a value to the parent window, so that the value can be transferred to the parent window in the mode window,

Then, refresh the parent window based on the value. In this way, the parent window will be automatically refreshed after any Mode window is closed.

Ii. Refresh mode this window
The showmodaldialo window is different from the window opened by window. Open When refreshing this window, the showmodaldialo window cannot be refreshed by F5, and there is no right key operation
A. Add the following content to the mode window:
<Base target = "_ Self"> // between HTML and body
<A id = "reload" href = "URL of this page" style = "display: none"> </a>

B. Execute the following JS Code where the refresh operation is required:
Reload. Click (); // reload indicates the ID of the hidden a tag in A. You can change it to another name.

3. Notes

When you click the link in the window. showmodaldialog window, a new window is opened. To prevent the new window from being opened, you need
Add: <base target = "_ Self"/>. Sometimes it is invalid and must be replaced with <base target = "_ Self"> </base>

Window. showmodaldialog methods and notes for refreshing the parent window and the current window:

I. Method to refresh the parent window:
A. Use window. returnvalue to pass a value to the parent window, and then judge whether to refresh the Window Based on the value.

On the window. showmodaldialog window page, use window. returnvalue to set the return value;
For example, window. returnvalue = 'refresh ';

B. When writing window. showmodaldialog window function, define a variable and operate the parent window according to the variable value;
For example, VAR winpar = Window. showmodaldialog (URLs, 'erpwindows', 'dialogwidth = '+ widths + 'px; dialogheight =' + heigths + 'px; status = no; center = yes; scroll = no ');
If (winpar = "refresh ")
Window. Location. Reload (); // executed when the window. showmodaldialog window is closed
The return value set by winpar for step a in the showmodaldialog window

Conclusion: The Window. showmodaldialog function opens an IE mode window (that is, the parent window cannot be operated after the window is opened, and the operation can only be performed when the mode window is closed ),

Therefore, to refresh the parent window, you can only execute it after the mode window is closed. Window. returnvalue can be used to pass a value to the parent window, so that the value can be transferred to the parent window in the mode window,

Then, refresh the parent window based on the value. In this way, the parent window will be automatically refreshed after any Mode window is closed.

Ii. Refresh mode this window
The showmodaldialo window is different from the window opened by window. Open When refreshing this window, the showmodaldialo window cannot be refreshed by F5, and there is no right key operation
A. Add the following content to the mode window:
<Base target = "_ Self"> // between HTML and body
<A id = "reload" href = "URL of this page" style = "display: none"> </a>

B. Execute the following JS Code where the refresh operation is required:
Reload. Click (); // reload indicates the ID of the hidden a tag in A. You can change it to another name.

3. Notes

When you click the link in the window. showmodaldialog window, a new window is opened. To prevent the new window from being opened, you need
Add: <base target = "_ Self"/>. Sometimes it is invalid and must be replaced with <base target = "_ Self"> </base>

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.