Js creates a subwindow and returns the sample code of the value.

Source: Internet
Author: User

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,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.