Window.showModalDialog() - Web APIs 编辑

Obsolete

This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

This feature has been removed. Please fix your Web sites and applications.

This method was removed in Chrome 43 and Firefox 56.

The Window.showModalDialog() created and displayed a modal dialog box containing a specified HTML document.

Syntax

returnVal = window.showModalDialog(uri[, arguments][, options]);
  • returnVal holds the returnValue property as set by the document specified by uri.
  • uri is the URL of the document to display in the dialog.
  • arguments is an optional variant containing values passed to the dialog; these are made available in the window object's window.dialogArguments property.
  • options is an optional string specifying window ornamentation for the dialog, using one or more semicolon delimited values:
SyntaxDescription
center: {on | off | yes | no | 1 | 0 }If on, yes, or 1, the dialog window is centered on the desktop; otherwise it's hidden. Default is yes.
dialogheight: heightThe height of the dialog box in pixels.
dialogleft: leftDistance of the dialog box from the left edge of the desktop.
dialogwidth: widthThe width of the dialog box in pixels.
dialogtop: topDistance of the dialog box from the top edge of the desktop.
resizable: {on | off | yes | no | 1 | 0 }If this argument's value is on, yes, or 1, the dialog window can be resized by the user; otherwise its size is fixed. The default value is no.
scroll: {on | off | yes | no | 1 | 0 }If on, yes, or 1, the dialog window has scroll bars; otherwise its size is fixed. Default is no.

Note:

Firefox does not implement the dialogHide, edge, status, or unadorned arguments.

Examples

Try out showModalDialog().

Notes

showModalDialog() was briefly standardized as part of HTML5. The third argument for additional options was not present in the HTML5 version.

Specifications

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:55 次

字数:4367

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文