读书人

运用frameset关闭窗口

发布时间: 2012-11-19 10:18:51 作者: rapoo

使用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>

读书人网 >Web前端

热点推荐