如果网页不是通过脚本程序打开的(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
$.ajax同步/异步(async:false/true)
link 和@import 的区别
如何对网页的加载进行性能优化
border-style有哪些值?
CSS设置DIV居中
jquery选择器
jQuery库中获取jQuery对象的方式
Observer,观察者模式,C++描述
Iterator,迭代器模式,C++描述