时间:2021-07-01 10:21:17 帮助过:6人阅读
<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>