idea: Use the window.showModalDialog method to get the reference to the pop-up subform, and then return the result with window.returnvalue= "* *" on the child page.
Sample code: (Simplifies implementation with jquery)
Parent page: parent.html
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Sub-page son.html
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Summarize:
parameter passing:
1. To pass the parameter to the dialog box, it is passed through varguments. Type is not restricted, for a string type, the maximum is 4,096 characters. You can also pass objects, for example:
-------------------------------
Parent.htm
<script>
var obj = new Object ();
Obj.name= "51js";
window.showModalDialog ("son.htm", obj, "dialogwidth=200px;dialogheight=100px");
</script>
Son.htm
<script>
var obj = window.dialogarguments
alert ("The parameter you passed is:" + obj.name)
</script>
2. You can return information by Window.returnvalue to the window that opens the dialog box, or you can also be an object. For example:
Parent.htm
<script>
str =window.showmodaldialog ("son.htm", "dialogwidth=200px;dialogheight=100px");
alert (str);
</script>
Son.htm
<script>
window.returnvalue= "http://blog.csdn.net/a497785609";
Extended:
In. NET, you can achieve AJAX effects in this way. When the subpage passes the parameters to be selected, the parent page implements the ICallbackEventHandler interface and passes the acquired value directly back to the server side. Or use the UpdatePanel Load event to catch the passed parameters, so as to continue the server-side processing.
Above this JavaScript pop-up subform and return the results to the parent form of the implementation code is small series to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.