Returnvalue is the property of the HTML window object in Javascript. It is used to return the window value.
Window. the showmodaldialog function is used to open an IE mode window (the mode window knows, that is, the parent window cannot be operated after it is opened, and can only be operated when the mode window is closed) and return the window value, the following is an example:
------------------------------------------------------------------------------
// Father.html
<HTML>
<Head>
<Meta name = "generator" content = "Microsoft Visual Studio 6.0">
<Title> </title>
<Script language = "JavaScript">
Function showmodal (){
VaR ret = Window. showmodaldialog ("child.htm", null, "dialogwidth: 350px; dialogheight: 350px; help: No; Status: No ");
If (RET) {alert ('subwindow returns true! ');
} Else {
Alert ('subwindow returns false! ');
}
}
</SCRIPT>
</Head>
<Body>
<Input id = button1 type = button value = button name = button1 onclick = "showmodal ();">
</Body>
</Html>
average
// child.html
If (TAG = 0 ){
Window. returnvalue = false;
} Else {
Window. returnvalue = true;
}
Window. Close ();
}
</SCRIPT>
</Head>
<Body>
<Input id = button1 type = button value = "returns true" name = button1 onclick = "Trans (1)">
<Input id = button2 type = button value = "false" name = button2 onclick = "Trans (0)">
</Body>
</Html>
-----------------------------------------------------------------------------
In this way, the value can be transferred from the mode window to the parent window,
In addition to boolean and integer values, this returnvalue can also be a JS array to transmit a large amount of data.
For details about how to use showmodaldialog, refer to msdn.
Reprinted from:Http://www.cnblogs.com/delin/archive/2010/06/18/1759967.html