当前位置: 代码迷 >> Web前端 >> 运用frameset关闭窗口
  详细解决方案

运用frameset关闭窗口

热度:26   发布时间:2012-11-19 10:18:51.0
使用frameset关闭窗口


在框架页面中,可以使用如下代码关闭页面

 

<html>
	<head>
		<title>模版</title>
       		<script type="text/javascript">
           
			function closeWin(){
				parent.window.opener=null;
				parent.window.close();			
			}
       		</script>
	</head>
	<body>

		<input type="button" value="关闭按钮" onclick="closeWin()"/>
	</body>
</html>

 

解决方案二

 


 

<html>
	<head>
		<title>模版</title>
       		<script type="text/javascript">
           
			function closeWin(){
				
				window.top.close();

				
			}
			

            
       </script>
	</head>
	<body>

		<input type="button" value="关闭按钮" onclick="closeWin()"/>
	</body>
</html>