62,041
社区成员
发帖
与我相关
我的任务
分享
<head runat="server">
<title>无标题页</title>
<script language="javascript">
function closewin()
{
if(confirm("你确定要关闭窗口吗?"))
window.close();
else
alert("窗口未关闭");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btn1" OnClientClick="closewin()" runat="server" /></div>
</form>
</body>
<script language="javascript">
function closewin()
{
if(confirm("你确定要关闭窗口吗?"))
window.close();
else
alert("窗口未关闭");
}
</script>
</head>
<body>
<input type="button" value="关闭窗口" onclick="closewin()" />
</body>
<script type="text/javascript">
function window.onbeforeunload() {
if (event.clientX > 360 && event.clientY < 0 || (event.altKey)) {
window.onbeforeunload = null;
//做你想处理的事
}
}
</script>