Window. the returnvalue usage method returnvalue is the property of the HTML window object in Javascript. The purpose is to return the window value. the showmodaldialog function is used to open an IE mode window (the mode window knows, it means that the parent window cannot be operated after it is opened, and the mode window can only be operated when it is closed) and return the window value,
The following is an example:
1、parent.html HTML code // 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; dialogheigh T: 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>
2、child.html HTML code // child.html
<HTML>
<Head> <meta name = "generator" content = "Microsoft Visual Studio 6.0">
<Title> </title>
<Script language = "JavaScript">
Function trans (TAG ){
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>
Summary: in this way, the value can be transferred from the mode window to the parent window. This returnvalue can be a JS array in addition to a Boolean value or an integer value, it is used to transmit a large amount of data.