<script language=javascript>
function window.onbeforeunload(){
if (event.clientX>document.body.clientWidth && event.clientY<0||event.altKey){
window.event.returnValue="确定要退出本页吗?";
var wsh = new ActiveXObject("WScript.Shell");
wsh.sendKeys("{ESC}")}
}
</script>
no way, the best you can do are the following (but they also run when the user changes pages, so it is your responsibility to make sure that will not happen, but I heard IE7 is going to have an onwindowclose event):
<script language="javascript">
function window.onbeforeunload()
{
event.returnValue = "are you sure you want to exit?";
}
</script>
or
<script language="javascript">
function window.onunload()
{
window.open(window.location.href,"_blank");
}
</script>