window.showModalDialog(sURL[,vArguments][,sFeatures])

vArguments 는 윈도우 객체가 들어갈 수 있으며,


sFeatures 모달창의 속성을 지정한다.


속성은 다음과 같다.


dialogHeight:sHeight Sets the height of the dialog window (see Remarks for default unit of measure).
dialogLeft:sXPos Sets the left position of the dialog window relative to the upper-left corner of the desktop.
dialogTop:sYPos Sets the top position of the dialog window relative to the upper-left corner of the desktop.
dialogWidth:sWidth Sets the width of the dialog window (see Remarks for default unit of measure).
center:{ yes | no | 1 | 0 | on | off } Specifies whether to center the dialog window within the desktop. The default isyes.
dialogHide:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window is hidden when printing or using print preview. This feature is only available when a dialog box is opened from a trusted application. The default isno.
edge:{ sunken | raised } Specifies the edge style of the dialog window. The default israised.
help:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays the context-sensitive Help icon. The default isyes.
resizable:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window has fixed dimensions. The default isno.
scroll:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays scrollbars. The default isyes.
status:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays a status bar. The default isyesfor untrusted dialog windows andnofor trusted dialog windows.
unadorned:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays the border window chrome. This feature is only available when a dialog box is opened from a trusted application. The default isno.


팝업창에서의 부모창을 컨트롤 하는 객체 - dialogArguments ( window.open의 opener와 같은 의미 )

모달창에서 submit()을 하면 새창이 뜨게 되는데, 새창을 뜨지 않게 하는 방법은 다음과 같다.


<head>
<base target="_self" />
</head>

head tag에 <base target="_self" />를 넣으면 된다.



# sample
 var attr = "dialogHeight=480px; dialogWidth=550px; scroll=auto; status=yes; help=no; center=yes";  
 var url = "action.do";
 window.showModalDialog(url, window, attr); 

+ Recent posts