2014-02-21

← Older revision

Revision as of 19:30, 21 February 2014

Line 1:

Line 1:

 

+

{{Page_Title}}

 

{{Flags

 

{{Flags

 

|High-level issues=Needs Topics, Missing Relevant Sections, Data Not Semantic, Unreviewed Import

 

|High-level issues=Needs Topics, Missing Relevant Sections, Data Not Semantic, Unreviewed Import



|Content=Incomplete, Not Neutral, Compatibility Incomplete, Examples Best Practices
, Cleanup

+

|Content=Incomplete, Not Neutral
, Cleanup
, Compatibility Incomplete, Examples Best Practices

 

+

|Checked_Out=No

 

}}

 

}}



{{Standardization_Status
|
}}

+

{{Standardization_Status}}

 

{{API_Name}}

 

{{API_Name}}

 

+

{{Summary_Section}}

 

{{API_Object_Method

 

{{API_Object_Method



|Parameters={{Method Parameter|Name=dialog|Data type=BSTR|Description='''String''' that specifies the URL of the document to load and display.|Optional=}}

+

|Parameters={{Method Parameter



{{Method Parameter|Name=varArgIn|Data type=VARIANT|Description='''Variant''' that specifies the arguments to use when displaying the document. Use this parameter to pass a value of any type, including an array of values. The dialog box can extract the values passed by the caller from the [[dom/
properties
/dialogArguments|'''dialogArguments''']] property
of the '''window''' object
.|Optional=}}

+

|Name=dialog



{{Method Parameter|Name=varOptions|Data type=VARIANT|Description='''String''' that specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values:|Optional=}}

+

|Data type=BSTR

 

+

|Description='''String''' that specifies the URL of the document to load and display.

 

+

|Optional=
No

 

+

}}{{Method Parameter

 

+

|Name=varArgIn

 

+

|Data type=VARIANT

 

+

|Description='''Variant''' that specifies the arguments to use when displaying the document. Use this parameter to pass a value of any type, including an array of values. The dialog box can extract the values passed by the caller from the [[dom/
WindowModal
/dialogArguments|'''dialogArguments''']] property.

 

+

|Optional=
No

 

+

}}{{Method Parameter

 

+

|Name=varOptions

 

+

|Data type=VARIANT

 

+

|Description='''String''' that specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values:

 

+

|Optional=
No

 

+

}}

 

|Method_applies_to=dom/HTMLElement

 

|Method_applies_to=dom/HTMLElement

 

|Example_object_name=object

 

|Example_object_name=object

Line 16:

Line 32:

 

 

 

'''Variant'''. Returns the value of the '''returnValue''' property as set by the window of the document specified in ''dialog''.

 

'''Variant'''. Returns the value of the '''returnValue''' property as set by the window of the document specified in ''dialog''.



 



 

 

}}

 

}}



{{Topics|DOM}}

 

 

{{Examples_Section

 

{{Examples_Section

 

|Not_required=No

 

|Not_required=No



|Examples={{
Single_Example

+

|Examples={{
Single Example

 

|Description=This example uses the '''showModalDialog''' method to open a customized dialog box.

 

|Description=This example uses the '''showModalDialog''' method to open a customized dialog box.



|LiveURL=http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialog2.htm

+

|Code=<script type{{=}}"text/javascript">



|Code=

+



<script type{{=}}"text/javascript">

+

 

function fnRandom(iModifier){

 

function fnRandom(iModifier){

 

   return parseInt(Math.random()*iModifier);

 

   return parseInt(Math.random()*iModifier);

Line 57:

Line 68:

 

   <input type{{=}}"button" value{{=}}"Push To Create" onclick{{=}}"fnOpen()">

 

   <input type{{=}}"button" value{{=}}"Push To Create" onclick{{=}}"fnOpen()">

 

</form>

 

</form>



}}}}

+

|LiveURL=http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialog2.htm

 

+

}}

 

+

}}

 

{{Notes_Section

 

{{Notes_Section



|Notes=

+

|Notes====Remarks===



===Remarks===

+

 

A modal dialog box retains the input focus while open. The user cannot switch windows until the dialog box is closed.

 

A modal dialog box retains the input focus while open. The user cannot switch windows until the dialog box is closed.



Because a modal dialog box can include a URL to a resource in a different domain, do not pass information through the ''varArgIn'' parameter that the user might consider private. The ''varArgIn'' parameter can be referenced within the modal dialog box using the [[dom/
properties
/dialogArguments|'''dialogArguments''']] property of the '''window''' object. If the ''varArgIn'' parameter is defined as a string, the maximum string length that can be passed to the modal dialog box is 4096 characters; longer strings are truncated.

+

Because a modal dialog box can include a URL to a resource in a different domain, do not pass information through the ''varArgIn'' parameter that the user might consider private. The ''varArgIn'' parameter can be referenced within the modal dialog box using the [[dom/
WindowModal
/dialogArguments|'''dialogArguments''']] property of the '''window''' object. If the ''varArgIn'' parameter is defined as a string, the maximum string length that can be passed to the modal dialog box is 4096 characters; longer strings are truncated.

 

You can set the default font settings the same way you set Cascading Style Sheets (CSS) attributes (for example, <code>"font:3;font-size:4"</code>). To define multiple font values, use multiple font attributes.

 

You can set the default font settings the same way you set Cascading Style Sheets (CSS) attributes (for example, <code>"font:3;font-size:4"</code>). To define multiple font values, use multiple font attributes.

 

To override <code>center</code>, even though the default for <code>center</code> is <code>yes</code>, you can specify either <code>dialogLeft</code> and/or <code>dialogTop</code>.

 

To override <code>center</code>, even though the default for <code>center</code> is <code>yes</code>, you can specify either <code>dialogLeft</code> and/or <code>dialogTop</code>.



When Windows Internet Explorer opens a window from a modal or modeless HTML dialog box by using the '''showModalDialog''' method or by using the [[dom/
methods
/showModelessDialog|'''showModelessDialog''']] method, Internet Explorer uses Component Object Model (COM) to create a new instance of the window. Typically, the window is opened by using the first instance of an existing Internet Explorer process. When Internet Explorer opens the window in a new process, all the memory cookies are no longer available, including the session ID. This process is different from the process that Windows Internet Explorer uses to open a new window by using the [[dom/
methods
/open|'''open''']] method.

+

When Windows Internet Explorer opens a window from a modal or modeless HTML dialog box by using the '''showModalDialog''' method or by using the [[dom/
HTMLElement
/showModelessDialog|'''showModelessDialog''']] method, Internet Explorer uses Component Object Model (COM) to create a new instance of the window. Typically, the window is opened by using the first instance of an existing Internet Explorer process. When Internet Explorer opens the window in a new process, all the memory cookies are no longer available, including the session ID. This process is different from the process that Windows Internet Explorer uses to open a new window by using the [[dom/
Window
/open|'''open''']] method.

 

For Windows Internet Explorer 7, <code>dialogHeight</code> and <code>dialogWidth</code> return the height and width of the content area and no longer includes the height and width of the frame.

 

For Windows Internet Explorer 7, <code>dialogHeight</code> and <code>dialogWidth</code> return the height and width of the content area and no longer includes the height and width of the frame.

 

Internet Explorer 7.  Although a user can manually adjust the height of a dialog box to a smaller value —provided the dialog box is resizable— the minimum <code>dialogHeight</code> you can specify is 100 pixels, and the minimum <code>dialogWidth</code> you can define is 250 pixels. In versions earlier than Internet Explorer 7 the minimum value of the <code>dialogWidth</code> that can be specified is 100 pixels.

 

Internet Explorer 7.  Although a user can manually adjust the height of a dialog box to a smaller value —provided the dialog box is resizable— the minimum <code>dialogHeight</code> you can specify is 100 pixels, and the minimum <code>dialogWidth</code> you can define is 250 pixels. In versions earlier than Internet Explorer 7 the minimum value of the <code>dialogWidth</code> that can be specified is 100 pixels.

Line 74:

Line 86:

 

The default unit of measure for <code>dialogHeight</code> and <code>dialogWidth</code> in Internet Explorer 5 and later  is the pixel. The value can be an integer or floating-point number, followed by an absolute units designator (<code>cm</code>, <code>mm</code>, <code>in</code>, <code>pt</code>, or <code>pc</code>) or a relative units designator (<code>em</code>, <code>ex</code>, or <code>px</code>). For consistent results, specify the <code>dialogHeight</code> and <code>dialogWidth</code> in pixels when designing modal dialog boxes.

 

The default unit of measure for <code>dialogHeight</code> and <code>dialogWidth</code> in Internet Explorer 5 and later  is the pixel. The value can be an integer or floating-point number, followed by an absolute units designator (<code>cm</code>, <code>mm</code>, <code>in</code>, <code>pt</code>, or <code>pc</code>) or a relative units designator (<code>em</code>, <code>ex</code>, or <code>px</code>). For consistent results, specify the <code>dialogHeight</code> and <code>dialogWidth</code> in pixels when designing modal dialog boxes.

 

As of Microsoft Internet Explorer 4.0, you can eliminate scroll bars on dialog boxes. To turn off the scroll bar, set the [[html/attributes/scroll|'''SCROLL''']] attribute to <code>false</code> in the '''body''' element for the dialog window, or call the modal dialog box from a trusted application.

 

As of Microsoft Internet Explorer 4.0, you can eliminate scroll bars on dialog boxes. To turn off the scroll bar, set the [[html/attributes/scroll|'''SCROLL''']] attribute to <code>false</code> in the '''body''' element for the dialog window, or call the modal dialog box from a trusted application.



|Import_Notes=

+

|Import_Notes====Syntax===



===Syntax===

+

 

===Standards information===

 

===Standards information===

 

There are no standards that apply here.

 

There are no standards that apply here.



 

 

}}

 

}}



{{
See_Also_Section

+

{{
Related_Specifications_Section



|
Manual_sections
=

+

|
Specifications
=



===Related pages (MSDN)===

+



*<code>window</code>

+



*<code>Reference</code>

+



*<code>[[dom/methods/showModelessDialog|showModelessDialog]]</code>

+



*<code>Conceptual</code>

+



*<code>About the Pop-up Blocker</code>

+

 

}}

 

}}

 

+

{{Compatibility_Section

 

+

|Not_required=No

 

+

|Imported_tables=

 

+

|Desktop_rows=

 

+

|Mobile_rows=

 

+

|Notes_rows=

 

+

}}

 

+

{{See_Also_Section}}

 

+

{{Topics|DOM}}

 

{{External_Attribution

 

{{External_Attribution

 

|Is_CC-BY-SA=No

 

|Is_CC-BY-SA=No

 

|Sources=MSDN

 

|Sources=MSDN



|MSDN_link=[http://msdn.microsoft.com/en-us/library/ie/hh828809%28v=vs.85%29.aspx Windows Internet Explorer API reference]

 

 

|MDN_link=

 

|MDN_link=

 

+

|MSDN_link=[http://msdn.microsoft.com/en-us/library/ie/hh828809%28v=vs.85%29.aspx Windows Internet Explorer API reference]

 

|HTML5Rocks_link=

 

|HTML5Rocks_link=

 

}}

 

}}

Show more