Showmodaldialog和window.open如何同时打开 [英] How Showmodaldialog and window.open opens simultaniously

查看:144
本文介绍了Showmodaldialog和window.open如何同时打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有两个窗户.一个是showmodaldialog,另一个是window.open.

我想一次抬高两个窗户.

如果我为两个窗口同时提供window.open,它将同时打开.但是当我们使用showmodaldialog和window.open时不会.

但是我的要求是使用showmodaldialog打开一个窗口,并使用window.open打开其他窗口.

谁能帮助我们

[PK:标记已更新]

Hi,

I am having two windows. One is showmodaldialog and other is window.open.

I want to raise both the windows at a time.

Wnen i give window.open for the two windows it gets open simultaniously. But it won''t when we use showmodaldialog and window.open.

But my requirement is to open one window with showmodaldialog and other with window.open.

Can any one help us

[PK: Tag updated]

推荐答案

同时打开两个窗口会遇到什么问题?

如果您按如下方式编写,则两个窗口将同时打开.

What is the problem you are getting when you are opening both the windows simultaneously?

If you write like following, both the window will open simultaneously.

function Load() {
            window.open("http://www.google.com");
            window.showModalDialog(''http://www.google.com'');
        }




但是,如果您将像下面这样编写,则在关闭模态对话框之前,不会打开弹出窗口, window.open行仅在模态对话框关闭后才执行.这是window.showModalDialog的默认行为.




But if you will write like following, your popup will not open until you close the modal dialog, your window.open line will only execute once the modal dialog is closed. This the the default behavior of window.showModalDialog.

function Load() {
          window.showModalDialog(''http://www.google.com'');
          window.open("http://www.google.com");
      }




按照第一种方法,您将能够同时打开它们.




Follow the first approach and you will be able to open them simultaneously.


模态对话框"旨在提示用户在继续执行该应用程序的其余部分之前对该窗口做出反应.如果您使用文件->在任何程序中打开...,该程序等待打开对话框完成后再继续.如果不等待,则应用程序首先需要再次检查是否需要保存任何当前更改.另外,您可以进入菜单并再次选择打开...".

解决方案是显示对话框,但不能简单地使用showModelessDialog作为模型.

http://msdn.microsoft.com/en-us/library/ms536761%28v = VS.85%29.aspx [ ^ ]

祝你好运!
A "modal dialog" is intended to prompt the user to react to that window before continuing with the rest of the application. If you use File -> Open... in any program, the program waits for the open dialog to finish before moving on. If this would not wait, the application would first need to check again if any current changes need to be saved. Also, you could go into the menu and choose "open..." again.

The solution is to show the dialog, but simply not as model using showModelessDialog.

http://msdn.microsoft.com/en-us/library/ms536761%28v=VS.85%29.aspx[^]

Good luck!


这篇关于Showmodaldialog和window.open如何同时打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆