윈도우를 해결합니다.오픈 값 문제

5389 단어 window.open
1.html
<script type="text/javascript">

        function showItem() {

        

             var  win = window.open("2.html",null," height=300,width=450,  Left=300px,Top=20px, menubar=no,titlebar=no,scrollbar=no,toolbar=no, status=no,location=no");

        

        }

    </script>

    

        <input type="button" id="txtId"/>

        <input type="button" id="txtName"/>

        <input type="button" id="btnShow" onclick="showItem();"  value=" "/>

2.html
 <script language="javascript" type="text/javascript">

       function check() {

    

              window.opener.document.getElementById("txtId").value="ID";

              window.opener.document.getElementById("txtName").value="NAME";

      }

    </script>

    

    <input type="button" id="btnSelect" onclick="check()"  value=" "/>    

좋은 웹페이지 즐겨찾기