index.html

来自「Java Web应用客户端编程」· HTML 代码 · 共 52 行

HTML
52
字号
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>window示例</title>
</head>
<script language="javascript">
<!--
	//打开模式窗口
	function open1(){
		//设置模式窗口的一些状态值
		var windowStatus = "dialogWidth:260px;dialogHeight:180px;center:1;status:0;";
		//在模式窗口中打开的页面
		var url = "test.html";
		//将模式窗口返回的值临时保存
		var temp = showModalDialog(url,"",windowStatus);
		//将刚才保存的值赋给文本输入框returnValue
		document.all.returnValue.value = temp;
	}
	
	//打开无菜单窗口
	function open2(){
		//设置窗口的一些状态值
		var windowStatus = "left=380,top=200,width=260,height=200,resizable=0,scrollbars=0,menubar=no,status=0";
		//在窗口中打开的页面
		var url = "test1.html";
 	    window.open(url,"noMenuWindowName",windowStatus);	 
	}
	
	//打开全屏窗口
	function open3(){
		//设置窗口的一些状态值
		var windowStatus = "fullscreen = 1";
		//在窗口中打开的页面
		var url = "test2.html";
 	    window.open(url,"noMenuWindowName",windowStatus);	 
	}
	
-->
</script>
<body>
	<input type="button" name="btn1" value="打开模式窗口" onClick="open1()">
	<br>
	从模式窗口返回的值:
	<input type="text" id="returnValue" name="returnValue">
	<br><br>
	<input type="button" name="btn2" value="打开无菜单窗口" onClick="open2()">
	<br><br>
	<input type="button" name="btn3" value="打开全屏窗口" onClick="open3()">
	<br><br>
</body>
</html>

⌨️ 快捷键说明

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