try:
<script>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
var a=window.open()
if(!confirm('要走了吗?'))a.location.href=location.href
else a.location.href='2.php'
}
}
</script>
<body>
helo
</body>
<script>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
var a=window.open()
if(!confirm('要走了吗?'))a.location.href=location.href
else a.location.href='2.php'
}
}
</script>
<body>
helo
</body>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
var a=window.open()
if(!confirm('要走了吗?'))a.location.href=location.href
else a.location.href='2.htm'
}
}
</script>
<body>
helo
</body>
<body onbeforeUnload="return '确定退出吗?';">
</body>