如果网页不是通过脚本程序打开的(window.open()),调用window.close()脚本关闭窗口前,必须先将window.opener对象置为null,否则浏览器(IE7、IE8)会弹出一个确定关闭的对话框。
<script language="javaScript">
function closeWindow()
{
window.opener = null;
window.open(' ', '_self', ' ');
window.close();
}
</script>
<input type='button' value='关闭窗口' onClick="closeWindow()">
或
<input type="button" value="关闭窗口" onClick="window.opener = null; window.open(' ', '_self', ' ');window.close()">
对于关闭框架窗口
<script language="javaScript">
function closeWindow()
{
window.opener = null;
window.open('', '_top', '');
window.parent.close();
}
</script>
0
0
Jeecg-Boot Spring Boot
MyBatis-Plus
Eclipse lombok java
MySQL 高可用性—keepalived+mysql双主
如何使用 Docker 来限制 CPU、内存和 IO等资源?
Requires: libc.so.6(GLIBC_2.14)(64bit)
项目管理、软件、禅道 VS JIRA
解决Window安全中心对Kitematic-0.17.3-Ubuntu.zip提示病毒,但无法删除的问题。
正则表达式 贪婪模式