Control the opening and closing of windows

From , 5 Years ago, written in JavaScript, viewed 94 times.
URL https://pastebin.vip/view/a5771bce
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  4. <title>控制窗口的打开和关闭</title>
  5. <style type="text/css">
  6. <!--
  7. /* 用于网页的CSS样式 */
  8. body {
  9.         font-family: "宋体";
  10.         font-size: 9pt;
  11.         margin-top: 0px;
  12.         margin-left: 0px;
  13.         margin-right: 0px
  14. }
  15. A {
  16.         color: black;
  17.         font-size: 9pt;
  18.         font-weight: 400;
  19.         text-decoration: none
  20. }
  21. A:hover {
  22.         color: red;
  23.         font-size: 9pt;
  24.         font-weight: 400;
  25.         text-decoration: underline
  26. }
  27. a:active {
  28.         font: 9pt "宋体";
  29.         cursor: hand;
  30.         color: #FF0033
  31. }
  32. -->
  33. </style>
  34. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  35. <script language="javascript">
  36. <!--
  37. function openclk()                      // 函数: 打开新的窗口。
  38. {
  39.         another=open('about:blank','NewWindow', "height=150, width=250");       // 调用window窗口对象的open来打开新窗口
  40. }
  41. function closeclk()                     // 函数: 关闭打开的窗口
  42. {
  43.         another.close();                // 调用close函数关闭窗口
  44. }
  45. //-->
  46. </script>
  47. </head>
  48.  
  49. <body>
  50. <center>
  51.   <h1>控制窗口的打开和关闭</h1>
  52.   <hr>
  53.   <br>
  54.   <table border=0 bordercolor=blue borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0">
  55.     <tr>
  56.       <td align=center><font size=4 color=red face="arial, helvetica, sans-serif"><strong>试试点击按钮看看!</strong></font></td>
  57.     </tr>
  58.     <tr>
  59.       <td align=center height=100 width=300><form>
  60.           <!-- 为按钮的onclick绑定openclk函数 -->
  61.           <input type="button" name="open" value="打开一个窗口" onClick="openclk()">
  62.           <br>
  63.           <!-- 为按钮的onclick绑定closeclk函数 -->
  64.           <input type="button" name="close" value="关闭这个窗口" onClick="closeclk()">
  65.         </form></td>
  66.     </tr>
  67.   </table>
  68. </center>
  69. </body>
  70. </html>
  71.  

Reply to "Control the opening and closing of windows"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website