Window. showModalDialog is the method of the pop-up mode window.
ReturnValue is the property of the html window object in javascript. It is used to return the window value. 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:
1、parent.html
// 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 (' The subwindow returns false! ') ;}</Script> </HEAD> <BODY> <INPUT id = button1 type = button value = Button name = button1 onclick = "showmodal (); "> </BODY> </HTML>
22.16child.html
// 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 Boolean value, an integer value, or a js array to transmit a large amount of data.
For details about how to use showModalDialog, refer to msdn.