JS implement pop-up window select information Fill in the text label and need to pay attention to the problem

Source: Internet
Author: User

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

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.