The window. showModalDialog () method is used to prevent the parent window from being operated. However, when the showModalDialog window is closed, a new window is always displayed. I started to think of this IE bug and later found that I wrote less <base target = "_ self"> on the page. Simply query the target attribute to the end:
Syntax
| HTML |
<ELEMENTTARGET= STarget...> |
| Scripting |
Object.Target[=STarget] |
Possible Values
| STarget |
StringThat specifies or distinct es one of the following values.
| Name |
The name of the target window or frame. |
| _ Blank |
Load the linked document into a new blank window. This window is not named. |
| _ Media |
Load the linked document into the HTML content area of the Media Bar. Available in Internet Explorer 6 or later. |
| _ Parent |
Load the linked document into the immediate parent of the document the link is in. |
| _ Search |
Load the linked document into the browser search pane. Available in Internet Explorer 5 or later. |
| _ Self |
Default. Load the linked document into the window in which the link was clicked (the active window ). |
| _ Top |
Load the linked document into the topmost window. |
|
The property is read/write. The property has a default value of _ self.
Expressions can be used in place of the preceding value (s), as of Microsoft Internet Explorer 5. For more information, see About Dynamic Properties.
Remarks
If there is no existing window or frame with the same name as specified in the target, a new window is opened with a name equal to the value of the target.
The window name is an optional argument in the open scripting method.
The property is read/write. The property has a default value of _ self. This statement indicates _ self by default. Why must it be added before use? I will study it later.