11-3.htm

来自「javascript 的原代码,是一本书的代码」· HTM 代码 · 共 44 行

HTM
44
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
  <script language="javascript">
      var newWindow ;
	  
	  function newWindow(){
	     if(!newWindow){
		      newWindow = window.open("1-5.html","mywindow","width=200,height=300");
         }else if(newWindow.focus){
		     newWindow.focus();
		 }
		
		 newWindow.location="1-5.htm";
		 newWindow.moveTo(0,0);
		 parent.window.moveTo(250,0);
		 
	  }
	  function writeToWindow(){
	     newWindow.document.open();
		 newWindow.document.focus();
		 var str ="<html><body><center>";
		 str += "AAAAAAAAAAAAAAAAAAAAAAAAAA<br>";
		 str += "BBBBBBBBBBBBBBBBBBBBBBBBBBBb<br>";
		 str += "</center></body></html>";
		 newWindow.document.write(str);
	  }
  </script>
</head>

<body>
  <center>
   <form>
      <input type="button" value="创建窗口" onClick="newWindow()">
	  <input type="button" value="写稳当" onClick="writeToWindow()">
   </form>
   </center>

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?