Page 1
// Display the window
Function frmshow (ARR ){
VaR old;
Var val = $. Trim ($ ("# Phone"). Val ());
If (val = ""){
Old = "";
} Else {
Old = Val + "\ n ";
}
For (VAR Int = 0; int <arr. length; int ++ ){
Old = old + arr [int];
}
$ ("# Phone"). Val (old );
}
Function GOTO (URL ){
VaR targetwndname = "mywindow ";
VaR WND = Window. Open ("", targetwndname );
VaR link = Document. getelementbyid ("Link ");
Link.tar get = targetwndname;
Link. href = URL;
Link. Click ();
}
Page 1 html
<A id = "Link" href = "javascript: void (0)" style = "visibility: hidden; position: absolute;"> </a>
<Input type = "button" value = "select Address Book" class = "BTN" onclick = "Goto ('<% = PATH %>/AM/push. do? M = Contact ') ">
<Textarea name = "phone" id = "phone" style = "width: 100%; height: 100% "rows =" 15 "data-Toggle =" tooltip "data-placement =" right "Title =" mobile phone number cannot be blank "> </textarea>
Page 2 JS
VaR sinit = function (){
VaR arry = new array ();
$ ("[Name = checkval]: checkbox: checked"). Each (function (){
Arry. Push ($ (this). Val () + "\ n ");
});
Window. opener. frmshow (arry); // The method of calling the parent window in the subwindow
Window. Close ();
}
Open another window through the tag (referrer is not lost)