window.open( );window.close( );

window.open("new.html","newwindow","width=400,height=400,left=0,top=0,toolbar=")

left:窗口X轴坐标;

top:浏览器Y轴坐标;

toolbar:是否显示浏览器的工具栏;

menubar:是否显示菜单栏;

scrollbars:是否显示滚动条;

location:是否显示地址字段;

status:是否添加状态栏;


window.close();关闭当前窗口

 
 
<script>
function openCe()
{
window.open("new.html","newwindow","width=400,height=600,toolbar=no,menubar=no,scrollbars=no,location=no,status=no")
}
function closeCe()
{
window.close();
							
}
</script>
	<button onClick="openCe()">打开新窗口open</button>
	<button onClick="closeCe()">关闭当前窗口</button>


猜你喜欢

转载自blog.csdn.net/qq_39871330/article/details/80692859