Javascript Reference
Categories: window

javascript window showModalDialog( )

@March 4, 2010, 3:15 a.m.
showModalDialog( ) It works on all browsers.

showModalDialog("URL"[, arguments[, "features"]])

  

Displays a special window that remains atop all browser windows until the user explicitly closes the dialog window. This kind of window is different from the browser windows generated with the window.open( ) method. A modal dialog has no scriptable relationship with its opening window once the dialog window is opened. All values necessary for displaying content must be in the HTML document that loads into the window or be passed as parameters. The modal dialog may then have a script set its returnValue property, which becomes the value returned to the original script statement that opened the modal dialog box as the returned value of the showModalDialog( ) method.

You can pass arguments to the modal dialog by creating a data structure that best suits the data. For a single value, a string will do. For multiple values, you can create a string with a unique delimiter between values, or create an array and specify the array as the second parameter for the showModalDialog( ) method. A script in the document loaded into the modal dialog can then examine the window.dialogArguments property and parse the arguments as needed for its scripting purposes. See the dialogArguments property for an example.

The third optional parameter lets you set physical characteristics of the dialog window. These characteristics are specified in a CSS-style syntax. Dimensions for dialogWidth, dialogHeight, dialogLeft, and dialogTop should be specified in pixels. An example of a call to a modal dialog is as follows:

var answer = window.showModalDialog("subDoc.html",argsVariable, 
"dialogWidth:300px; dialogHeight:200px; center:yes");

None of the third parameter characteristics are recognized by the Macintosh version of Internet Explorer 4, which creates a full-size modal dialog.

Modal dialogs can present problems for scripts if the window loads a frameset. A script in one of the frames will likely not be able to reference the parent or top window to gain access to either the window's close( ) method or content in another frame.

Parameters
Feature Value Description
center yes | no | 1 | 0 | on | off Center the dialog
dialogHeight Length/units Outer height of dialog
dialogLeft Integer Left pixel offset (overrides center)
dialogTop Integer Top pixel offset (overrides center)
dialogWidth Length/units Outer width of dialog
edge raised | sunken Transition style between border and content area
help yes | no | 1 | 0 | on | off Display help icon in titlebar
resizable yes | no | 1 | 0 | on | off Dialog is resizable
status yes | no | 1 | 0 | on | off Display status bar
  • A complete or relative URL as a string.
  • Data as a number, string, or array to be passed to the scripts in the document loaded into the modal dialog.
  • A string of semicolon-delimited style attributes and values to set the physical characteristics of the modal dialog. Available attributes are as shown in the following table.
Returned Value

The value (if any) assigned to the window.returnValue property in the document loaded into the modal dialog window.

$500 loan <a href="https://payday365day.org">personal loans online for bad credit</a> loans today <a href=https://payday365day.org>payday loans online bad credit ok</a> how long to pay off a loan
instalment loans online <a href="https://payday365day.org">fast personal loans online</a> 3 year loans <a href=https://payday365day.org>cash advance roanoke va</a> apply for small loan
loans las vegas <a href="https://payday365day.org">emergency personal loans bad credit</a> check loans <a href=https://payday365day.org>need loan today</a> 2500 loan
loan today <a href="https://payday365day.org">pacific cash advance</a> get loan fast <a href=https://payday365day.org>first time loan</a> installment loans bad credit online
payday loans - 3 weeks
manufactured homes loans <a href="https://payday365day.org">emergency cash assistance</a> tribal loans <a href=https://payday365day.org>fast loans with monthly payments</a> personal loan bad credit online
startup loans bad credit <a href="https://payday365day.org">cash loan with bad credit</a> loans in minutes <a href=https://payday365day.org>money loans bad credit</a> interest on loans
best long term installment loans for bad credit <a href="https://payday365day.org">short term personal loans</a> personal debt consolidation <a href=https://payday365day.org>personal loans reviews</a> loan rates
bad credit personal loan <a href="https://payday365day.org">short term loans compare</a> loan against tax return <a href=https://payday365day.org>payday loans surrey b c</a> fast loans for bad credit with monthly payments
payday loans - 3 weeks
california loans <a href="https://payday365day.org">90 day loans</a> loans for bad credit online <a href=https://payday365day.org>loan online application</a> 30 day loans
personal loans usa <a href="https://payday365day.org">loan advance</a> loans in pa <a href=https://payday365day.org>free cash online</a> internet loan
2600 installment loans california <a href="https://payday365day.org">personal loan fast</a> cash loan with bad credit <a href=https://payday365day.org>online cash register</a> personal loan for debt consolidation
fast loan with bad credit <a href="https://payday365day.org">texas payday loan</a> loans in milwaukee <a href=https://payday365day.org>easy loan</a> installment loan for bad credit
payday loans - 3 weeks

Powered by Linode.