1. Similarities and Differences between showmodaldialog and showmodelessdialog
The two pop-up forms cannot be refreshed.
Exception: the former is a modal window and always obtains the focus. The latter is a non-modal window, but a page is displayed, and the parent window can be operated.
2. Close the showmodaldialog and showmodelessdialog pop-up windows.
<Input type = "button" value = "buttonclick" onclick = "self. Close ();">
3. How can I operate the button in the new window of showmodaldialog and showmodelessdialog, but not the new window?
Add <base target = "_ Self"> between
4. Return Value of showmodaldialog
Example:
T1.html:
<Script language = "JavaScript">
Function showpage ()
{
Alert (showmodaldialog ("t2.html "));
}
</SCRIPT>
<Input type = "button" value = "getval" onclick = "showpage ();">
T2.html
<HTML>
<Head>
<Script language = "JavaScript">
<
Function setval ()
{
Returnvalue = "ABC ";
Close ();
}
// -->
</SCRIPT>
</Head>
<Body>
<Input type = "button" value = "btn1" onclick = "setval ();">
</Body>
</Html>
Window. Close close the window. Close the window without a system prompt.
When we use this method: Response. Write ("<SCRIPT> window. Close () </SCRIPT> ")
Always Prompt: the prompt that the webpage you are viewing is trying to close
How do I remove the prompt and close the form directly?
You can use the following methods:
Response. Write ("<SCRIPT> window. Opener = NULL; window. Close () </SCRIPT> ")
Only IE6 is supported.
Opener can be set to any value without any prompt
How can I close a parent form through a child form?
Subform (pop-up form ):
Likewise:
Response. Write ("<SCRIPT> window. opener. Top. Opener = NULL; window. opener. Top. Close () </SCRIPT> ")
<Object ID = HH1 classid = "CLSID: ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<Param name = "command" value = "minimize"> </Object>
<Object ID = HH2 classid = "CLSID: ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<Param name = "command" value = "maximize"> </Object>
<Object ID = hh3 classid = "CLSID: adb880a6-d8ff-11cf-9377-00aa003b7a11">
<Param name = "command" value = "close"> </Object>
<Input type = button value = minimized onclick = hh1.click ()>
<Input type = button value = maximized onclick = hh2.click ()>
<Input type = button value = Disable onclick = hh3.click ()>