This article mainly introduces window. for how to use showModalDialog, You need to receive a task two days before using it: when a user uploads an attachment, You need to verify the ID card information in the attachment uploaded by the user, if an error message exists, all the error messages must be displayed.
At the beginning, I considered using jQuery Dialog. However, we can see that showModelDialog is not used for this project, so showModelDialog is also required for unification.
The window. showModalDialog () method is used to create a modal dialog box that displays HTML content. Because it is a dialog box, it does not have all the properties of the window opened by window. open.
Usage:
VarreturnValue = window. showModalDialog (URL [, arguments] [, features])
Parameter description:
URL: Required parameter: Specifies the URL of the document to be displayed in the dialog box.
Arguments: Optional. Used to pass parameters to the dialog box. The passed parameter types are not limited, including arrays. The dialog box uses window. dialogArguments to obtain the passed parameters.
Features is an optional parameter. Used to describe the appearance and other information of the dialog box. You can use one or more of the following, separated by semicolons.
The height of the dialogHeight dialog box, which is not smaller than PX.
DialogWidth: Dialog Box width.
DialogLeft: The left distance from the desktop.
DialogTop: the distance from the desktop.
Center: {yes | no | 1 | 0}: whether the window is centered. The default value is yes, but the height and width can still be specified. Help: {yes | no | 1 | 0}: whether to display the help button. The default value is yes. Resizable: {yes | no | 1 | 0} [ie5 +]: whether the size can be changed. No by default. Status: {yes | no | 1 | 0} [IE5 +]: whether to display the status bar. The default value is yes [Modeless] or no [Modal]. Scroll: {yes | no | 1 | 0 | on | off}: Specifies whether the scroll bar is displayed in the dialog box. The default value is yes.
Example:
The Code is as follows:
Var rv = window. showModalDialog ("<% = path %>/query/query_showErrorInfo.action", "", "dialogWidth = 600px; dialogHeight =" + height + "px; dialogLeft = 400px; dialogTop = 200px; center = no; resizable = no ");
Height: controls the display quantity.
Url: it is an action. The action user obtains information about all error personnel. Go to the errorInfo. jsp page at the same time
ErrorInfo. jsp
The Code is as follows:
<% @ Page language = "java" import = "java. util. *" pageEncoding = "UTF-8" %>
<% @ Taglib uri = "/struts-tags" prefix = "s" %>
Batch query of persons with incorrect identities