The showmodaldialog dialog box appears in JSP.

Source: Internet
Author: User

Source: http://www.cnblogs.com/adandelion/archive/2005/10/26/262666.html

 

The showmodaldialog cache is serious. The following is how to cancel the client cache settings in the subwindow.
<Meta http-equiv = "expires" content = "0">
<Meta http-equiv = "cache-control" content = "no-Cache">
<Meta http-equiv = "Pragma" content = "no-Cache">
Bytes -----------------------------------------------------------------------------------------

Farther.html
---------------------------
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
<Title> new document </title>
<Meta name = "generator" content = "editplus">
<Meta name = "author" content = "">
<Meta name = "keywords" content = "">
<Meta name = "Description" content = "">
<Script language = "JavaScript">
<! --
Function openchild (){

VaR K = Window. showmodaldialog ("child.html", window, "dialogwidth: 335px; Status: No; dialogheight: 300px ");
If (K! = NULL)
Document. getelementbyid ("txt11"). value = K;
}
// -->
</SCRIPT>
</Head>

<Body>
<Br> value passed to the parent window: <input id = "txt9" type = "text" value = "3333333333333"> <br>
Returned value: <input id = "txt11" type = "text"> <br>
Value set in the subwindow: <input id = "txt10" type = "text"> <br>

<Input type = "button" value = "openchild" onclick = "openchild ()">
</Body>
</Html>
---------------------------------------------------------------
Child.html
--------
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<HTML>
<Head>
<Title> new document </title>
<Meta name = "generator" content = "editplus">
<Meta name = "author" content = "">
<Meta name = "keywords" content = "">
<Meta name = "Description" content = "">
<Meta http-equiv = "expires" content = "0">
<Meta http-equiv = "cache-control" content = "no-Cache">
<Meta http-equiv = "Pragma" content = "no-Cache">

</Head>

<Body>
<Br> value passed by the parent window: <input id = "txt0" type = "text"> <br>
Enter the value of the parent window to be set: <input id = "txt1" type = "text"> <input type = "button" value = "set the value of the parent window" onclick = "setfather ()"> <br>
Value returned by the input: <input id = "txt2" type = "text"> <input type = "button" value = "" onclick = "retrunvalue ()">
<Input type = "button" value = "Close refresh parent window" onclick = "">

</Body>
</Html>

<Script language = JavaScript>
<! --
VaR K = Window. dialogarguments;
// Obtain the value passed by the parent window
If (K! = NULL)
{
Document. getelementbyid ("txt0"). value = k.doc ument. getelementbyid ("txt9"). value;
}
// Set the value of the parent window
Function setfather ()
{
K.doc ument. getelementbyid ("txt10"). value = Document. getelementbyid ("txt1"). Value
}
// Set the value returned to the parent window
Function retrunvalue ()
{
VaR S = Document. getelementbyid ("txt2"). value;
Window. returnvalue = s;
Window. Close ();
}
// -->
</SCRIPT>

----------------------------

 

Related Article

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.