window open new Windows case

Source: Internet
Author: User

//Some browser security level is relatively high, because of the security of JS, so there will be no access to local files, but there is no actual development of this situation, because the domain name, not the local file address. <HTML> <Head>  <title>HTML example</title> </Head> <Body>Number:<inputtype= "text"ID= "Numid"/><BR/>Name:<inputtype= "text"ID= "NameID"/><BR/> <inputtype= "button"value= "Select"onclick= "Open1 ()"/><Scripttype= "Text/javascript">functionOpen1 () {window.open ("user.html","","width=250,height=150");}</Script> </Body></HTML>

Here is the code for user.html

<HTML> <Head>  <title>HTML example</title> </Head> <Body> <TableBorder= "1"bordercolor= "Blue"> <TR>    <TD>Operation</TD>    <TD>Number</TD>    <TD>Name</TD> </TR> <TR>    <TD> <inputtype= "button"value= "Select"onclick= "open2 (' 100 ', ' Zhang San ');"/></TD>    <TD>100</TD>    <TD>Tom</TD> </TR> <TR>    <TD> <inputtype= "button"value= "Select"onclick= "Open2 (' 101 ', ' John Doe ');"/></TD>    <TD>101</TD>    <TD>John doe</TD> </TR> <TR>    <TD> <inputtype= "button"value= "Select"onclick= "Open2 (' 102 ', ' Harry ');"/></TD>    <TD>102</TD>    <TD>Harry</TD> </TR> </Table><Scripttype= "Text/javascript"> functionOpen2 (num1,name1) {varPwin=Window.opener; Pwin.document.getElementById ("Numid"). Value=num1; Pwin.document.getElementById ("NameID"). Value=name1; Window.close ();}</Script> </Body></HTML>

The result shown as point selection will appear click on Figure 2 of the selection number and name will be shown in Figure 1

window open new Windows case

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.