window.showModalDialog() and window.showModelessDialog()
2007-01-28 20:19
|
Internet Explorer has a couple non-standard extensions to the window object: window.showModalDialog() and window.showModelessDialog(), both of which create true dialog-type windows. These dialogs are much better suited than normal windows (as created by window.open()) for use in web applications.
Unfortunately, though, these dialogs have several annoying bugs and limitations: Window targeting is broken, so new opening URLs always opens new windows (even when a target window is explicitly set). Each of these actions is affected: Submitting forms Opening hyperlinks Programmatically using window.navigate(), window.location=url, window.location.assign(), window.location.reload(), window.location.replace() The window.opener property is neglected. It should refer to the opening window object (where window.showModalDialog() was called), but is empty instead. Keyboard shortcuts are disabled. IE's context menu is disabled. Cookies are inconsistently available in the dialog. The CSS accelerator property is broken. It is simply ignored. The document.title property is partially broken. It can only be set declaratively with <title></title> tags when the page loads, but not programmatically at runtime (actually it can be changed at runtime, but those changes are never shown in the dialog's titlebar). |
本文探讨了Internet Explorer中非标准的window.showModalDialog()和window.showModelessDialog()方法,这两种方法用于创建真正的对话框窗口。文章详细介绍了这些对话框的优点及其在Web应用中的适用性,并列举了一些已知的问题和限制。
498

被折叠的 条评论
为什么被折叠?



