<script language=javascript>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";}
}
</script>
function window.onbeforeunload()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";}
}
</script>
...
</body>
再次请教各位!
可是按画面中的关闭按钮(onclick="window.close();")却不弹msg。
function quit()
{
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";}
}
</script>
onclick="javascript:quit();window.close();")
function window::onbeforeunload(){
if (event.clientY<0 && event.clientX>document.body.clientWidth-20
|| event.clientY<0 && event.clientX<20
|| event.altKey
|| event.clientY>document.body.clientHeight)
event.returnValue="真的要走?"
}
</script>
<button onclick="if (confirm('真的要走?')) window.close()">关闭</button>
<html>
<head>
<script language="JavaScript">
<!--
var flag = 0;//Prompt for quitting
function leaveAlert()
{
if ( flag == 1 )
return 'Are you sure to Leave Current Window?';
}
//-->
</script>
</head>
<body onbeforeunload="return leaveAlert();">
<a href="about:blank" onclick="flag=0;">Leave Without Prompt
<br>
<a href="about:blank" onclick="flag=1;">Leave With Prompt
</body>
</html>
function window::onbeforeunload(){
if (event.clientY<0 && event.clientX>document.body.clientWidth-20
|| event.clientY<0 && event.clientX<20
|| event.altKey
|| event.clientY>document.body.clientHeight)
event.returnValue="真的要走?"
}
</script>
<button onclick="if (confirm('真的要走?')) window.close()">关闭</button>
┏━★━━◆━━★━┓
♂欢|◢CSDN◣|使♂ ▲自由保存帖子,浏览,关注检测
┃迎|◥论坛助手◤|用┃ ▲完善的CSDN客户端工具
┗━☆━━◇━━━☆┛ ▲自动添加签名......让你更快,更爽,更方便地上CSDN...
http://www.csdn.net/expert/topic/573/573604.xml
http://www.chinaok.net/csdn/csdn.zip