Window ShowModalDialog Content
(1) Parent page Open window
(2) parent page passing parameters to child page
(3) The child page gets the parameters passed by the parent page and returns a certain value.
Code:
function getHQ1 (option) {
Parent page passes parameters to a child page in 2 ways
// 1) Add parameters and values directly to the URL. such as:/tbpweb/technology/institutionmanager/technologytextarea.jsp?opt=2
///2) var obj = new Object (); obj. Name = "QQ";
///3) var rowdata = window.showModalDialog (url, obj, "Dialogwidth:750px;dialogheight:250px;edge: Sunken;help:no;resizable:yes;scroll:no;status:no;unadorned:no ");
var url = "/tbpweb/technology/institutionmanager/technologytextarea.jsp?opt=2";
var num=math.random ();
var rowdata = window.showmodaldialog (url, window, "DIALOGWIDTH:750PX;DIALOGHEIGHT:250PX;EDGE:SUNKEN;HELP:NO; Resizable:yes;scroll:no;status:no;unadorned:no ");
if (typeof (RowData)! = "undefined") {
Get return value
var rowdata1=rowdata+ "";
var msg=rowdata1.split ("*");
var str=msg[1]+ "" +msg[2];
var strs=msg[0]+ "" +STR;
}
}
The child page gets the parent window pass parameter, and returns the information
1) Gets the parameter passed by URL:
$ (document). Ready (function () {
var href=window.location.href;
var hre= "";
if (href.split ("="). length==2) {
Hre=href.split ("=") [1];
if (Hre.split ("[email protected]"). length!= "")
Hre1=hre.replace (/[email protected]/g, "\ n");
Hre1=hre1.replace (/[email protected]/g, "=");
$ ("#hqyj"). Val (Hre1);
}
});
2) Gets the arguments passed by the object method:
$ (document). Ready (function () {
var obj = window.dialogarguments
var name = Obj.name;
});
3) The Sub-page returns information.
Window.returnvalue = "Apple * lychee";