js 弹出全屏窗口 关闭赋值

来源:互联网 发布:淘宝设置子账号名字 编辑:程序博客网 时间:2024/05/21 18:47
index.php
  1. <html><head>
  2. <title>可惜不是你</title></head>
  3. <script language="JavaScript">
  4.       function openWin(u, w, h) {
  5.          /*
  6.             var l = (screen.width - w) / 2;
  7.             var t = (screen.height - h) / 2;
  8.             var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l;
  9.             s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no';
  10.             open(u, 'oWin', s);
  11.             */
  12.             window.open ('url.php''newwindow''fullscreen')
  13.             //window.open("url.php","","scrollbars=yes,resizable=yes")
  14.       }
  15. </script>
  16. <body onload="openWin()">
  17. <a href="javascript:void(openWin('url.php', '', ''));">可惜不是你</a>
  18. <INPUT TYPE="text" NAME="ceshi" ID="ceshi" value="">
  19. </body>
  20. </html>
url.php
  1. <SCRIPT LANGUAGE="JavaScript">
  2. function addValue(){
  3.     window.opener.document.getElementById('ceshi').value =document.getElementById('test').value;
  4.     window.close();
  5.     //parent.document.getElementById("test1").value = document.getElementById("test").value;
  6. }
  7. function closeValue(){
  8.      window.opener.location.reload();   
  9.      window.close();
  10. }
  11. </SCRIPT>
  12. <INPUT TYPE="text" NAME="test" ID="test" value="">
  13. <INPUT TYPE="button" NAME="test" ID="test" value="Add" onclick="addValue()">
  14. <INPUT TYPE="button" NAME="test" ID="test" value="Update" onclick="closeValue()">
原创粉丝点击