Copy can be used directly!
Copy codeThe Code is as follows: // The parent window
Function onClick (){
Var k = showModalDialog (
"View/WriteKey. jsp", included page
"Newwindow", fixed values
"DialogHeight: 200px;
DialogWidth: 400px; Width
Toolbar: no; whether a toolbar exists
Menubar: no; whether the menu bar exists
Scrollbars: no; scroll bar
Resizable: no;
Location: no; Address Bar
Status: no; status Bar
Left: 100px;
Top: 100px; "); alas there are two other attributes that you don't remember. Go to the next level.
// K is the return value of the window.
// Judge k
If (k! = Null & typeof (k )! = Undefined ){
.......... OK
}
}
// Subwindow "view/WriteKey. jsp
<Input type = "password" maxlength = "6" id = "dy" value = ""/> </p>
<P> <input id = "PostAction" onclick = "trans ();" class = "btn-green" type = "button" value = "Confirm submission">
JS Section
Function trans (tag ){
Var s = document. getElementById ("dy"). value + document. getElementById ("keyZ"). value;
Window. returnValue = s;
Window. close ();
}
OK, finished,