通过window.showModalDialog打开页面有什么不同?
有人知道其中的区别吗?
我遇到的问题是,当通过 window.showModalDialog
打开时,页面停止正常工作
Anyone knows the difference?
The problem I met is that the page stops working correctly when opened by window.showModalDialog
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
window.showModalDialog 与 window.open
Window.open 将通过 Javascript 打开一个新窗口,并将 URL 和窗口的其他功能作为参数传递。这里打开新窗口的父窗口和子窗口是独立的窗口。
例如。下面
Window.showModalDialogue 再次与 window.open 类似,唯一的区别是它是一个模态窗口,它作为一个新窗口打开,但不允许用户访问父窗口,除非你明确关闭它。
这里子窗口依赖于父窗口。如果关闭父窗口,子窗口也会关闭。
window.showModalDialog("xpopupex.htm","name","dialogWidth:255px;dialogHeight:250px");
当您希望用户在新窗口中执行特定操作时,可以使用 ShowModalDialogue 窗口在他再次访问父窗口之前。就像在他可以访问父页面之前登录一样。
尝试使其尽可能简单...希望这有所帮助..;)
window.showModalDialog vs window.open
Window.open will open up a new window through Javascript, with the URL and other features of the window that u pass as parameters. Here the parent window which opens the new window and the child window are independent windows.
Eg. Below
Window.showModalDialogue again works smilar to a window.open only diffrence being its a Modal window, It opens up as a new window but doesnt allow the user to access the parent window, unless you explicitly close it.
Here the child window is dependent on the parent window. If you close the parent window the child would also get closed.
window.showModalDialog("xpopupex.htm","name","dialogWidth:255px;dialogHeight:250px");
ShowModalDialogue windows can be used when u want the user to perform a particular action in the new window before he access the parent window again. like login before he can access the parent page..
tryed to make it as simple as possible...hope this help.. ;)