<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
<SCRIPT>
// Complete the following functions to open a new mode window.
Function openshowmodaldialog (){
VaR OBJ = window;
VaR Params = new array ("aaaa", OBJ );
VaR returnvalue = Window. showmodaldialog ("demo04_01.html", Params );
Document. getelementbyid ("showcontentdiv"). innerhtml = returnvalue;
}
</SCRIPT>
</Head>
<Body>
<H1> usage of the mode window: <H3> complete the openshowmodaldialog function and open a new mode window <Button onclick = "openshowmodaldialog ();"> open a new mode window </button>
<Br>
<HR>
<Div id = "showcontentdiv">
</Div>
</Body>
</Html>
DEM004-01.html
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
<SCRIPT>
// Fill in the completion function, set the value of the returnvalue in the text box to the return value of the parent window, and close this window
Function closeshowmodaldialog (){
// Obtain the parameters of the mode form.
VaR P = Window. dialogarguments;
Window. returnvalue = Document. getelementbyid ("returnvalue"). value;
// Set the return value of the parent form. P [1] actually gets the reference of the parent form.
P [1]. returnvalue = Document. getelementbyid ("returnvalue"). value;
Window. Close ();
}
</SCRIPT>
</Head>
<Body>
<H1> usage of the mode window: <H3> complete the closeshowmodaldialog function, set the returnvalue value of the text box to the return value of the parent window, and close this window <Button onclick = "closeshowmodaldialog ();"> set the return value and close the window </button>
<HR>
Window Return Value
<Input type = "text" id = "returnvalue" value = "set the return value here">
</Body>
</Html>