Here is the complete code for the main page code for two pages
1 <!DOCTYPE HTML>2 <HTML>3 4 <Head>5 <MetaCharSet= "Utf-8" />6 <title>Window pop-up window</title>7 </Head>8 9 <Body>Ten Number: One <inputtype= "text"ID= "NumId" /> A <BR/>Name: - <inputtype= "text"ID= "NameId" /> - <BR/> the <inputtype= "button"value= "Select"onclick= "Opennewwindow ()" /> - <Scripttype= "Text/javascript"> - //the method realization of the popup window - functionOpennewwindow () { + window.open ("user.html", "", "width=250,height=150"); - } + </Script> A </Body> at - </HTML>
Popup Window Code
1 <!DOCTYPE HTML>2 <HTML>3 4 <Head>5 <MetaCharSet= "Utf-8" />6 <title>User</title>7 </Head>8 9 <Body>Ten <Tablewidth= "$"Border= "1"> One <TR> A <TD>Operation</TD> - <TD>Number</TD> - <TD>Name</TD> the </TR> - <TR> - <TD> - <inputtype= "button"value= "Select"onclick= "S1 (' 001 ', ' Foolish ')"> + </TD> - <TD>001</TD> + <TD>A fool's green</TD> A </TR> at <TR> - <TD> - <inputtype= "button"value= "Select"onclick= "S1 (' 002 ', ' Joker Xue ')"> - </TD> - <TD>002</TD> - <TD>Joker Xue</TD> in </TR> - <TR> to <TD> + <inputtype= "button"value= "Select"onclick= "S1 (' 003 ', ' Ma Liang ')"> - </TD> the <TD>003</TD> * <TD>Ma Liang</TD> $ </TR>Panax Notoginseng </Table> - the <Scripttype= "Text/javascript"> + functionS1 (NUM1, name1) { A varThewindow=Window.opener;//get the previous window the TheWindow.document.getElementById ("numId"). Value=NUM1; + TheWindow.document.getElementById ("nameId"). Value=name1; - //Close Window $ window.close (); $ } - </Script> - </Body> the - </HTML>
The result is that Internet Explorer and Firefox can operate normally
And in Google Browser will find unable to select, after clicking No response
This is because Google browser security level is relatively high, does not support the local file cross-page operation, when I put it on the server, it can be normal operation
The following are the operations in myeclipse2017 (which can theoretically be run directly on the server)
Put the HTML file under the project and run it on the server
Enter the corresponding path in Google browser to successfully fill in the information
JS implement pop-up window select information to fill in the text label and need to pay attention to the problem