<body onbeforeunload="return('确定要退出吗?');">
解决方案 »
- 为什么js关闭窗口的时候还要弹出一个对话框?
- jsp中使用combox控件与div的运用问题
- 网上看到一个面试题,看看你多长时间能算出来。
- 问个奇怪的问题,为什么document.write没有输出?
- 字符串替換問題
- 关于JQ选择元素的问题
- 当select框为disable的时候,能够改变select字体的颜色吗???
- 妹妹急求一个类似outlook的菜单
- 如何获得在一个<input type=image>单击的坐标值
- 表单中fileUpload选项中文件的属性的提取
- 谁能告诉我parseInt("08")等于几
- 在层中有一个SELECT对象,当单击下拉按钮的时候,显示层中的下拉框,应该如何设置?
window.onbeforeunload = function()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
return "别走嘛~!~!~!~!";
}
}
</script>
</body>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><body><script language="JavaScript">
<!--
function CloseWin()
{
var ua=navigator.userAgent
var ie=navigator.appName=="Microsoft Internet Explorer"?true:false
if(ie)
{
var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))))
if(IEversion< 5.5)
{
var str = '<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">'
str += '<param name="Command" value="Close"></object>';
document.body.insertAdjacentHTML("beforeEnd", str);
document.all.noTipClose.Click();
}
else
{
window.opener =null;
window.close();
}
}
else
{
window.close()
}
}
function queclose()
{
if(confirm("你确定关闭吗?"))
CloseWin();
}
//-->
</script>
<input type="button" onclick="queclose()" value="关闭">
</body>
</html>