过时
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.
Window.showModalDialog()
created and displayed a modal dialog box containing a specified HTML document.
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
对象的
window.dialogArguments
特性。
选项
is an optional string specifying window ornamentation for the dialog, using one or more semicolon delimited values:
| 句法 | 描述 |
|---|---|
center: {on | off | yes | no | 1 | 0 }
|
若
on
,
yes
,或
1
, the dialog window is centered on the desktop; otherwise it's hidden. Default is
yes
.
|
dialogheight:
height
|
The height of the dialog box in pixels. |
dialogleft:
left
|
Distance of the dialog box from the left edge of the desktop. |
dialogwidth:
width
|
The width of the dialog box in pixels. |
dialogtop:
top
|
Distance 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 }
|
若
on
,
yes
, or 1, the dialog window has scroll bars; otherwise its size is fixed. Default is
no
.
|
dialogHide
,
edge
,
status
,或
unadorned
自变量。
showModalDialog()
was briefly standardized as part of HTML5. The third argument for additional options was not present in the HTML5 version.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
showModalDialog
弃用
非标
|
Chrome ? — 43 | Edge No | Firefox 3 — 56 | IE 4 | Opera No |
Safari
5.1
|
WebView Android No | Chrome Android No | Firefox Android No | Opera Android No | Safari iOS No | Samsung Internet Android No |
完整支持
不支持
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
见实现注意事项。
<dialog>
, a replacement for
window.showModalDialog()
.
<dialog>
and
generators
Window
applicationCache
caches
closed
console
controllers
crossOriginIsolated
crypto
customElements
defaultStatus
devicePixelRatio
dialogArguments
目录
document
event
frameElement
frames
fullScreen
history
indexedDB
innerHeight
innerWidth
isSecureContext
isSecureContext
length
localStorage
location
locationbar
menubar
mozAnimationStartTime
mozInnerScreenX
mozInnerScreenY
mozPaintCount
名称
navigator
onabort
onafterprint
onanimationcancel
onanimationend
onanimationiteration
onappinstalled
onauxclick
onbeforeinstallprompt
onbeforeprint
onbeforeunload
onblur
oncancel
oncanplay
oncanplaythrough
onchange
onclick
onclose
oncontextmenu
oncuechange
ondblclick
ondevicelight
ondevicemotion
ondeviceorientation
ondeviceorientationabsolute
ondeviceproximity
ondragdrop
ondurationchange
onended
onerror
onfocus
onformdata
ongamepadconnected
ongamepaddisconnected
ongotpointercapture
onhashchange
oninput
oninvalid
onkeydown
onkeypress
onkeyup
onlanguagechange
onload
onloadeddata
onloadedmetadata
onloadend
onloadstart
onlostpointercapture
onmessage
onmessageerror
onmousedown
onmouseenter
onmouseleave
onmousemove
onmouseout
onmouseover
onmouseup
onmozbeforepaint
onpaint
onpause
onplay
onplaying
onpointercancel
onpointerdown
onpointerenter
onpointerleave
onpointermove
onpointerout
onpointerover
onpointerup
onpopstate
onrejectionhandled
onreset
onresize
onscroll
onselect
onselectionchange
onselectstart
onstorage
onsubmit
ontouchcancel
ontouchstart
ontransitioncancel
ontransitionend
onunhandledrejection
onunload
onuserproximity
onvrdisplayactivate
onvrdisplayblur
onvrdisplayconnect
onvrdisplaydeactivate
onvrdisplaydisconnect
onvrdisplayfocus
onvrdisplaypointerrestricted
onvrdisplaypointerunrestricted
onvrdisplaypresentchange
onwheel
opener
origin
outerHeight
outerWidth
pageXOffset
pageYOffset
parent
性能
personalbar
pkcs11
screen
screenLeft
screenTop
screenX
screenY
scrollbars
scrollMaxX
scrollMaxY
scrollX
scrollY
self
sessionStorage
sidebar
speechSynthesis
status
statusbar
toolbar
top
visualViewport
window
alert()
atob()
back()
blur()
btoa()
cancelAnimationFrame()
cancelIdleCallback()
captureEvents()
clearImmediate()
clearInterval()
clearTimeout()
close()
confirm()
convertPointFromNodeToPage()
convertPointFromPageToNode
createImageBitmap()
dump()
fetch()
find()
focus()
forward()
getAttention()
getComputedStyle()
getDefaultComputedStyle()
getSelection()
home()
matchMedia()
minimize()
moveBy()
moveTo()
open()
openDialog()
postMessage()
print()
prompt()
queueMicrotask()
releaseEvents()
requestAnimationFrame()
requestFileSystem()
requestIdleCallback()
resizeBy()
resizeTo()
restore()
routeEvent()
scroll()
scrollBy()
scrollByLines()
scrollByPages()
scrollTo()
setCursor()
setImmediate()
setInterval()
setTimeout()
showModalDialog()
sizeToContent()
stop()
updateCommands()
event
afterprint
animationcancel
animationend
animationiteration
beforeprint
beforeunload
blur
copy
cut
DOMContentLoaded
error
focus
hashchange
languagechange
load
message
messageerror
offline
online
orientationchange
pagehide
pageshow
paste
popstate
rejectionhandled
storage
transitioncancel
unhandledrejection
unload
vrdisplayconnect
vrdisplaydisconnect
vrdisplaypresentchange