Usage of the mode window

Source: Internet
Author: User

<! 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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.