<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>
var flag=false; //设置一个标志, 看是不是由于点击了链接而发生了页面跳转
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey||flag)
{
window.event.returnValue = "";
//这里你可以写上你想做的操作
}
}
function document.onclick()
{
flag = window.event.srcElement.tagName=="A";
}
</script>
<a href=aa.htm>aaaa</a>
alert("Hello");
}