首页 > 其他 > 详细

作业:按钮控制打开关闭新窗口及新窗口按钮关闭父窗口

时间:2015-11-13 22:16:00      阅读:330      评论:0      收藏:0      [点我收藏+]

父窗口 a.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>父窗口</title>
</head>

<body>

<input type="button" value="打开新窗口" onclick="zi=window.open(‘b.html‘, ‘子窗口‘,‘width=300,height=300 top=50,left = 100, scrollbars=yes, resizeable=yes, toolbar=yes,menubar=yes,location=yes‘);" />

<input type="button" value="关闭子窗口" onclick="zi.close();" />


</body>

 子窗口 b.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<input type="button" value="关闭父窗口" onclick="window.opener.close();">
</body>
</html>

 

作业:按钮控制打开关闭新窗口及新窗口按钮关闭父窗口

原文:http://www.cnblogs.com/dirgo/p/4963334.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!