javascript 用 window.open 替换 window.showmodaldialog
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15622395/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
replacing window.showmodaldialog with window.open
提问by Pankaj
In Many application, many of popups are implemented using window.showmodaldialog which restricts user to finish work on popup before changing focus to any other aprt of application. I want to change the implementation from modal dialog (window.showmodaldialog) to independent window (window.open). could you please help me with steps which has to be followed ?
在许多应用程序中,许多弹出窗口是使用 window.showmodaldialog 实现的,它限制用户在将焦点更改为任何其他应用程序之前完成弹出窗口的工作。我想将实现从模态对话框(window.showmodaldialog)更改为独立窗口(window.open)。你能帮我完成必须遵循的步骤吗?
回答by Ravindra Gullapalli
It is quite simple window.open([URL], 'width=[some number],height=[some number]');
.
这很简单window.open([URL], 'width=[some number],height=[some number]');
。
In this if you have any return values with window.showmodaldialog
which you are using in the opener window, you have to handle them with window.opener
.
在这种情况下,如果您window.showmodaldialog
在 opener 窗口中使用了任何返回值,则必须使用window.opener
.
Have a look at https://developer.mozilla.org/en-US/docs/DOM/window.openhttp://www.w3schools.com/jsref/met_win_open.asp
看看https://developer.mozilla.org/en-US/docs/DOM/window.open http://www.w3schools.com/jsref/met_win_open.asp